home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / trn / part01 next >
Encoding:
Internet Message Format  |  1991-12-02  |  91.7 KB

  1. Subject:  v25i004:  trn 2.0 - threaded newsreader based on rn 4.4, Part01/13
  2. Newsgroups: comp.sources.unix
  3. Approved: vixie@pa.dec.com
  4.  
  5. Submitted-by: davison@borland.com (Wayne Davison)
  6. Posting-number: Volume 25, Issue 4
  7. Archive-name: trn/part01
  8.  
  9. [ Like all versions of rn, this one just builds and installs and runs
  10.   with no special tweaking.  If you're in the market for a new free
  11.   newsreading tool, try this one.  Especially if you miss "Notesfiles".
  12.  
  13.   This posting is an experiment of sorts.  I packaged the shar files
  14.   into ~90K chunks instead of ~60K chunks.  If this doesn't break any-
  15.   thing out there in news-land, I'll probably make ~90K the standard.
  16.  
  17.                                 -- mod ]
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 1 (of 13)."
  26. # Contents:  EXTERN.h INIT INTERN.h MANIFEST README addng.h art.h
  27. #   artio.h artsrch.h artstate.h autosub.c autosub.h backpage.h
  28. #   cheat.h decode.c decode.h final.h help.h init.h intrp.h kfile.h
  29. #   last.h makedir.SH mbox.saver.SH mt-lint.h mt.check.SH mthreads.h
  30. #   ng.h ngdata.h ngsrch.h ngstuff.h nntp nntp/support.patch
  31. #   norm.saver.SH only.h patchlevel rcln.h respond.h rn.h rthreads.h
  32. #   search.h server.c server.h.SH sw.h threads.h tm-process.c
  33. #   tm-read.c tm-write.c unipatch.c util.h
  34. # Wrapped by vixie@cognition.pa.dec.com on Tue Dec  3 16:34:50 1991
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. if test -f 'EXTERN.h' -a "${1}" != "-c" ; then 
  37.   echo shar: Will not clobber existing file \"'EXTERN.h'\"
  38. else
  39. echo shar: Extracting \"'EXTERN.h'\" \(817 characters\)
  40. sed "s/^X//" >'EXTERN.h' <<'END_OF_FILE'
  41. X/* $Id: EXTERN.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  42. X *
  43. X * $Log: EXTERN.h,v $
  44. X * Revision 4.4  1991/09/09  20:18:23  sob
  45. X * release 4.4
  46. X *
  47. X *
  48. X * 
  49. X */
  50. X/* This software is Copyright 1991 by Stan Barber. 
  51. X *
  52. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  53. X * use this software as long as: there is no monetary profit gained
  54. X * specifically from the use or reproduction of this software, it is not
  55. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  56. X * included prominently in any copy made. 
  57. X *
  58. X * The author make no claims as to the fitness or correctness of this software
  59. X * for any use whatsoever, and it is provided as is. Any use of this software
  60. X * is at the user's own risk. 
  61. X */
  62. X
  63. X#undef EXT
  64. X#define EXT extern
  65. X
  66. X#undef INIT
  67. X#define INIT(x)
  68. X
  69. X#undef DOINIT
  70. END_OF_FILE
  71. if test 817 -ne `wc -c <'EXTERN.h'`; then
  72.     echo shar: \"'EXTERN.h'\" unpacked with wrong size!
  73. fi
  74. # end of 'EXTERN.h'
  75. fi
  76. if test -f 'INIT' -a "${1}" != "-c" ; then 
  77.   echo shar: Will not clobber existing file \"'INIT'\"
  78. else
  79. echo shar: Extracting \"'INIT'\" \(8 characters\)
  80. sed "s/^X//" >'INIT' <<'END_OF_FILE'
  81. X+Hfrom 
  82. END_OF_FILE
  83. if test 8 -ne `wc -c <'INIT'`; then
  84.     echo shar: \"'INIT'\" unpacked with wrong size!
  85. fi
  86. # end of 'INIT'
  87. fi
  88. if test -f 'INTERN.h' -a "${1}" != "-c" ; then 
  89.   echo shar: Will not clobber existing file \"'INTERN.h'\"
  90. else
  91. echo shar: Extracting \"'INTERN.h'\" \(860 characters\)
  92. sed "s/^X//" >'INTERN.h' <<'END_OF_FILE'
  93. X/* $Id: INTERN.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  94. X *
  95. X * $Log: INTERN.h,v $
  96. X * Revision 4.4  1991/09/09  20:18:23  sob
  97. X * release 4.4
  98. X *
  99. X *
  100. X * 
  101. X */
  102. X/* This software is Copyright 1991 by Stan Barber. 
  103. X *
  104. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  105. X * use this software as long as: there is no monetary profit gained
  106. X * specifically from the use or reproduction of this software, it is not
  107. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  108. X * included prominently in any copy made. 
  109. X *
  110. X * The author make no claims as to the fitness or correctness of this software
  111. X * for any use whatsoever, and it is provided as is. Any use of this software
  112. X * is at the user's own risk. 
  113. X */
  114. X
  115. X#undef EXT
  116. X#define EXT
  117. X
  118. X#undef INIT
  119. X#ifdef xenix
  120. X#define INIT(x) =x
  121. X#else
  122. X#define INIT(x) = x
  123. X#endif
  124. X
  125. X#define DOINIT
  126. END_OF_FILE
  127. if test 860 -ne `wc -c <'INTERN.h'`; then
  128.     echo shar: \"'INTERN.h'\" unpacked with wrong size!
  129. fi
  130. # end of 'INTERN.h'
  131. fi
  132. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  133.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  134. else
  135. echo shar: Extracting \"'MANIFEST'\" \(7940 characters\)
  136. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  137. X   File Name        Archive #    Description
  138. X-----------------------------------------------------------
  139. X Configure                 12    A shell script that installs everything system dependent.
  140. X EXTERN.h                   1    When included, makes other includes not belong to me.
  141. X HACKERSGUIDE               2    A brief guide to the contorted innards of [t]rn.
  142. X HINTS                      2    Some helpful hints to get the most out of using trn.
  143. X INIT                       1    Sample system-wide switch file.
  144. X INTERN.h                   1    When included, makes other includes belong to me.
  145. X MANIFEST                   1    This list of files.
  146. X Makefile.SH                3    The makefile.
  147. X NEW                        5    List of new features with trn 2.0.
  148. X Pnews.1                    2    Manual page for Pnews.
  149. X Pnews.SH                   6    A news posting shell script that knows about -h.
  150. X README                     1    Installation instructions and other tidbits.
  151. X Rnmail.1                   2    Manual page for Rnmail.
  152. X Rnmail.SH                  3    A mailer that knows about -h.
  153. X addng.c                    3    Routines for scanning the active file for new newsgroups.
  154. X addng.h                    1    Public info regarding addng.c.
  155. X art.c                      8    Routines to display an article.
  156. X art.h                      1    Public info regarding art.c.
  157. X artio.c                    2    Reserved for the article abstract type, someday.
  158. X artio.h                    1    Public info regarding artio.c.
  159. X artsrch.c                  3    Routines for searching among articles.
  160. X artsrch.h                  1    Public info regarding artsrch.c.
  161. X artstate.h                 1    Info on the current state of the article.
  162. X autosub.c                  1    Routines to allow automatic subscription management
  163. X autosub.h                  1    Public info regarding autosub.c
  164. X backpage.c                 2    Routines for paging backwards in articles.
  165. X backpage.h                 1    Public info regarding backpage.c.
  166. X bits.c                     7    Bitmap management functions.
  167. X bits.h                     2    Public info regarding bits.c.
  168. X cheat.c                    2    Routines to do lookahead of several types.
  169. X cheat.h                    1    Public info regarding cheat.c.
  170. X common.h                   8    Global info.
  171. X config.h.SH                3    Shell script to create config.h
  172. X decode.c                   1    Routines common to the binary decoders
  173. X decode.h                   1    Public info for the binary decoders.
  174. X final.c                    3    Finalization (exit) routines.
  175. X final.h                    1    Public info regarding final.c.
  176. X getactive.c                2    Program used by shell scripts to the active file (trrn only).
  177. X getdate.y                  5    A yacc script for date parsing.
  178. X head.c                     3    Header parsing routines.
  179. X head.h                     2    Public info regarding head.c.
  180. X help.c                     6    Help routines.
  181. X help.h                     1    Public info regarding help.c.
  182. X init.c                     3    Initialization (startup) routines.
  183. X init.h                     1    Public info regarding init.c.
  184. X intrp.c                    9    Filename expansion and % interpretation routines.
  185. X intrp.h                    1    Public info regarding intrp.c.
  186. X kfile.c                    3    KILL file routines.
  187. X kfile.h                    1    Public info regarding kfile.c.
  188. X last.c                     2    Routines for handling the .rnlast file.
  189. X last.h                     1    Public info regarding last.c.
  190. X makedepend.SH              2    Shell script to generate make dependencies.
  191. X makedir.SH                 1    Shell script to make nested subdirectories.
  192. X mbox.saver.SH              1    Shell script to save an article to a mailbox.
  193. X mt-lint.h                  1    A kludge file included when lint'ing.
  194. X mt-misc.c                  2    Miscellaneous mthreads routines
  195. X mt-process.c              11    Mthreads' article processing routines.
  196. X mt-read.c                  6    Mthreads' data-file reading routines.
  197. X mt-write.c                 4    Mthreads' data-file writing routines.
  198. X mt.check.SH                1    A sample mt.log checker/trimmer.
  199. X mthreads.8                 4    The man page for mthreads.
  200. X mthreads.c                10    The main workloop for the mthreads database manager.
  201. X mthreads.h                 1    The include file for accessing the 'mt' structures.
  202. X ndir.c                     2    BSD 4.2 directory routine emulation.
  203. X ndir.h.SH                  2    Shell script to make ndir.h file
  204. X newsetup.1                 2    Manual page for newsetup.
  205. X newsetup.SH                2    Shell script to create a .newsrc file.
  206. X newsgroups.1               2    Manual page for newsgroups.
  207. X newsgroups.SH              2    Shell script to list unsubscribed newsgroups.
  208. X newsnews.SH                2    A motd-like file that trn may print at startup.
  209. X ng.c                      10    Routines to display a newsgroup.
  210. X ng.h                       1    Public info regarding ng.c.
  211. X ngdata.c                   3    General data fetching routines for a newsgroup.
  212. X ngdata.h                   1    Public info regarding ngdata.c.
  213. X ngsrch.c                   2    Routines to search among newsgroups.
  214. X ngsrch.h                   1    Public info regarding ngsrch.c.
  215. X ngstuff.c                  4    Support routines for ng.c.
  216. X ngstuff.h                  1    Public info regarding ng.c.
  217. X nntp                       1    Subdirectory for NNTP support files
  218. X nntp/acttimes.c            4    A program to maintain active.times for NNTP or standalone
  219. X nntp/support.patch         1    A patch for NNTP's support dir to use acttimes.c.
  220. X nntp/xthread.patch         4    A patch for NNTP to add XTHREAD support.
  221. X norm.saver.SH              1    Shell script to save an article to a normal file.
  222. X only.c                     2    Routines to perform newsgroup restriction.
  223. X only.h                     1    Public info regarding only.c.
  224. X patchlevel                 1    Indicates current patch level.
  225. X rcln.c                     5    Routines to mung a .newsrc line.
  226. X rcln.h                     1    Public info regarding rcln.c.
  227. X rcstuff.c                  9    Routines to mung the .newsrc file.
  228. X rcstuff.h                  2    Public info regarding rcstuff.c.
  229. X respond.c                  7    Various routines for doing things with articles.
  230. X respond.h                  1    Public info regarding respond.c.
  231. X rn.c                       6    Main program.
  232. X rn.h                       1    Public info regarding rn.c.
  233. X rt-rn.c                    7    Misc. threaded routines.
  234. X rt-select.c                7    The thread selector.
  235. X rthreads.c                 4    Routines that read the thread data files in reader format.
  236. X rthreads.h                 1    The include file for accessing the 'rt' structures.
  237. X search.c                   5    Regular expression processing ala emacs.
  238. X search.h                   1    Public info regarding search.c.
  239. X server.c                   1    Routines common to NNTP server calls.
  240. X server.h.SH                1    Public info regarding the NNTP clientlib.
  241. X sw.c                       5    Switch processing routines.
  242. X sw.h                       1    Public info regarding switch.c.
  243. X term.c                     8    Terminal interface routines.
  244. X term.h                     4    Public info regarding term.c.
  245. X threads.c                  2    Routines common to both thread makers and readers.
  246. X threads.h                  1    The include file for common thread structures.
  247. X tm-process.c               1    Tmpthread's article processing routines.
  248. X tm-read.c                  1    Tmpthread's data-file reading routines.
  249. X tm-write.c                 1    Tmpthread's data-file writing routines.
  250. X tmpthread.c                3    Generates a temporary thread file for a newsgroup.
  251. X trn.1                     13    Manual pages for trn -- PLEASE READ.
  252. X unipatch.c                 1    A unified diff filter for use with old versions of patch.
  253. X unship.c                   5    Decodes ship files.
  254. X util.c                     6    Utility routines.
  255. X util.h                     1    Public info regarding util.c.
  256. X uudecode.c                 4    Decodes uuencoded files.
  257. END_OF_FILE
  258. if test 7940 -ne `wc -c <'MANIFEST'`; then
  259.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  260. fi
  261. # end of 'MANIFEST'
  262. fi
  263. if test -f 'README' -a "${1}" != "-c" ; then 
  264.   echo shar: Will not clobber existing file \"'README'\"
  265. else
  266. echo shar: Extracting \"'README'\" \(9176 characters\)
  267. sed "s/^X//" >'README' <<'END_OF_FILE'
  268. X              Trn Kit, Version 2.0
  269. X
  270. X            Copyright (c) 1991, Wayne Davison
  271. X
  272. X            Based on rn, Version 4.4
  273. X
  274. X             Copyright (c) 1985, Larry Wall
  275. X                     Copyright (c) 1991, Stan Barber
  276. X
  277. You may copy the trn kit in whole or in part as long as you don't try to
  278. make money off it, or pretend that you wrote it.
  279. X--------------------------------------------------------------------------
  280. X
  281. Please read all the directions in this file (following the brief description
  282. of trn) before you proceed with the installation.  Failure to do so may void
  283. your warranty. :-)
  284. X
  285. If you're upgrading from trn 1.x, read the ** LOOK ** section in the file NEW.
  286. X
  287. After you have unpacked your kit, you should have all the files listed
  288. in MANIFEST.
  289. X
  290. X
  291. What is trn?
  292. X------------
  293. Trn is "Threaded RN" -- a newsreader that uses an article's "References:"
  294. to order the discussions in a very natural, reply-ordered sequence called
  295. X"threads."  Having the replies associated with their parent articles not
  296. only makes following the discussion easier, but also makes it easy to back-
  297. track and (re-)read a specific discussion from the beginning.  Trn also
  298. has a visual representation of the current thread in the upper right corner
  299. of the header, which will give you a feel for how the discussion is going
  300. and how the current article is related to the last one you read.
  301. X
  302. In addition, a thread browser/selector is available to make life in the big
  303. newsgroups a much nicer place.  You can also choose to use it to browse
  304. through already-read articles and select the one(s) you wish to read again.
  305. Other nice features include the extract commands for the source and binary
  306. groups (that recently migrated into the mainstream rn code from trn), thread-
  307. oriented kill directives, a better newgroup finding strategy, and the abandon
  308. command.
  309. X
  310. To use all the threaded features of trn requires the maintainence of a special
  311. X"thread" file for each group.  If you have about 5% of your newsspool size
  312. in free space somewhere on your system, you'll probably want to maintain a
  313. full database of thread files by running mthreads at regular intervals.  If
  314. space is limited, some or all groups can be left unthreaded by mthreads, and
  315. trn will either read the group unthreaded or create a temporary thread file
  316. for the group when it is being read.  This runtime threading will cause an
  317. delay when starting up a medium or large group, so chose this only if you
  318. can't spare the space.
  319. X
  320. Trn can be optionally compiled as trrn -- a NNTP-compatible newsreader that
  321. lets you access news from a remote news server.  Each client machine must
  322. have access to a thread database.  This can either be maintained locally
  323. via an NNTP version of mthreads, shared via NFS, or accessed remotely via
  324. the XTHREAD extention to NNTP.  See the file nntp/xthread.patch for details
  325. about modifying NNTP 1.5.11 into an XTHREAD-compatible version.
  326. X
  327. Trn is based on the source to rn 4.4, and the threaded extensions are fully
  328. conditionalized.  Thus, it is possible to use this source to compile both trn
  329. and rn.  In fact, it is possible to install trn as both rn and trn (linked
  330. together) to maintain only one newsreader on a system where people wish to
  331. continue to use rn.
  332. X
  333. X
  334. X
  335. Installation
  336. X------------
  337. X
  338. X1)  Decide where you want to put the thread files.  The recommended spot
  339. X    for people with over 5% of your /usr/spool/news size free is to place
  340. X    a ".thread" file in each spool directory.  The other alternative is
  341. X    to create a directory for them (possibly on another drive) and enter
  342. X    this path at the appropriate Configure question.  Remember that you are
  343. X    not required to create thread files for all groups.  Some sites choose
  344. X    to only thread high-volume discussion groups (see the mthreads manpage),
  345. X    which will lower the amount of space required for thread files.  All
  346. X    other groups can be threaded on the fly when trn is running, if the
  347. X    user desires to do so.  If you are making an NNTP XTHREAD version of
  348. X    trn, then you must read the file nntp/xthread.patch and follow its
  349. X    directions first.
  350. X
  351. X2)  If you are trying to make the NNTP version of trn, be sure you have 
  352. X    installed the NNTP inews.  Trrn expects that the NNTP is at least
  353. X    version 1.5.  You will need the source to nntp (at least the stuff
  354. X    in the common directory) to respond to Configure's question about
  355. X    where the root of the nntp source tree resides.
  356. X
  357. X    The thread database created by mthreads must be accessable on each
  358. X    machine, which means that NNTP machines will need to maintain a local
  359. X    copy (usually by running the NNTP version of mthreads), or share a
  360. X    common copy (via either NFS or XTHREADS).
  361. X
  362. X3)  Run Configure.  This will figure out various things about your system.
  363. X    Some things Configure will figure out for itself, other things it will
  364. X    ask you about.  It will then proceed to make config.h, config.sh, the
  365. X    Makefile, and a bunch of shell scripts.  It will also do a make depend
  366. X    for you, or let you start one in the background.  You might possibly
  367. X    have to trim # comments from the front of Configure if your sh doesn't
  368. X    handle them, but all other # comments will be taken care of.
  369. X
  370. X4)  Glance through config.h and common.h to make sure system dependencies
  371. X    are correct.  Most of them should have been taken care of by running
  372. X    the Configure script.
  373. X
  374. X    If you have any additional changes to make to the C definitions, they
  375. X    can be done in the Makefile, in config.h, or in common.h.  If you have
  376. X    strange mailboxes on your system you should modify mbox.saver to correctly
  377. X    append an article to a mailbox or folder.
  378. X
  379. X    If you are on a machine with limited address space, you may have to
  380. X    remove some of the special functions of trn to make it fit.  This is
  381. X    easily done by undefining symbols in the System Dependencies section
  382. X    of common.h.  You should run "make depend" again to be safe.
  383. X
  384. X5)  make
  385. X
  386. X    This will attempt to make trn, tmpthread, and (usually) mthreads in the
  387. X    current directory.
  388. X
  389. X6)  make install
  390. X
  391. X    This will put trn, tmpthreads, newsetup, newsgroups, Pnews, and Rnmail
  392. X    into a public directory (normally /usr/local/bin), and put a number of
  393. X    files -- including mthreads (the database manager executable) -- into
  394. X    the private trn library (e.g. /usr/local/lib/trn).  It will also try to
  395. X    put the trn man page in a reasonable place.
  396. X
  397. X7)  Read the manual entry before running trn, or at least read the file
  398. X    NEW if you are already familiar with trn.  Those that are brand new
  399. X    to trn can get a quick idea of what's different from rn by reading
  400. X    the WHAT'S NEW section of the man page.  Also check out the HINTS
  401. X    file for some ways to get the most out of using trn.
  402. X
  403. X8)  Try trn, and play with some of the switches.  Use the -a option with -x
  404. X    to read each group threaded without having to create thread files (yet).
  405. X    Also try the -X option.  Any options you find that you want to make the
  406. X    default for everyone can be placed into the INIT file in the trn library.
  407. X    Personal defaults can be put in a file and the environment variable TRNINIT
  408. X    defined to point to it.
  409. X
  410. X9)  Once trn is running ok, you'll probably want to create a database of
  411. X    thread files to shorten the startup time for entering a group.  If you
  412. X    like, you can start small with a command like: "mthreads rec.humor.funny"
  413. X    just to see if things are working, and then add more hierarchies with a
  414. X    command like "mthreads news".  To turn on all groups, use the command
  415. X    "mthreads all" (one time).  See the man page for details.
  416. X
  417. X10) Arrange to have the mthreads command of your choosing run on a regular
  418. X    basis.  If you run with the daemon flag, you can start it from the boot
  419. X    sequence (make sure it is su'ed appropriately), or even run it daily
  420. X    out of cron (if it's already running, the new version will exit).  If
  421. X    you run mthreads in single-pass mode, you'll want to have cron execute
  422. X    it regularly with the standard-output redirected to /dev/null.
  423. X
  424. X11) IMPORTANT!  Help save the world!  Communicate any problems and suggested
  425. X    patches to Wayne Davison (davison@borland.com) so we can keep the world
  426. X    in sync.  If you have a problem, there's someone else out there who either
  427. X    has had or will have the same problem.  If the problem affects regular rn,
  428. X    code, I will pass it on to Stan Barber.
  429. X
  430. X    If possible, send in patches such that the patch program will apply them.
  431. X    Unified or regular context diffs are the best, then normal diffs.  Don't
  432. X    send ed scripts--I've probably changed my copy since the version you have.
  433. X
  434. X    Watch for trn patches in news.software.readers.  Patches will always be
  435. X    in the unified context diff format, for application by the patch program.
  436. X    If you don't have a patch program that handles unified context diffs,
  437. X    you'll probably want to get one (such as patch version 12u4).  Otherwise,
  438. X    you can use the (included) filter 'unipatch', which can be generated with
  439. X    the command 'make unipatch'.  To apply patches, use the command:
  440. X
  441. X    unipatch <patchfile | patch -p
  442. X
  443. X12) If you are going to hack on trn, please refer to rn's HACKERSGUIDE first.
  444. END_OF_FILE
  445. if test 9176 -ne `wc -c <'README'`; then
  446.     echo shar: \"'README'\" unpacked with wrong size!
  447. fi
  448. # end of 'README'
  449. fi
  450. if test -f 'addng.h' -a "${1}" != "-c" ; then 
  451.   echo shar: Will not clobber existing file \"'addng.h'\"
  452. else
  453. echo shar: Extracting \"'addng.h'\" \(989 characters\)
  454. sed "s/^X//" >'addng.h' <<'END_OF_FILE'
  455. X/* $Id: addng.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  456. X *
  457. X * $Log: addng.h,v $
  458. X * Revision 4.4  1991/09/09  20:18:23  sob
  459. X * release 4.4
  460. X *
  461. X *
  462. X * 
  463. X */
  464. X/* This software is Copyright 1991 by Stan Barber. 
  465. X *
  466. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  467. X * use this software as long as: there is no monetary profit gained
  468. X * specifically from the use or reproduction of this software, it is not
  469. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  470. X * included prominently in any copy made. 
  471. X *
  472. X * The author make no claims as to the fitness or correctness of this software
  473. X * for any use whatsoever, and it is provided as is. Any use of this software
  474. X * is at the user's own risk. 
  475. X */
  476. X
  477. void    addng_init ANSI((void));
  478. X#ifdef FINDNEWNG
  479. X    bool    newlist ANSI((bool_int,bool_int));
  480. X# ifdef ACTIVE_TIMES
  481. X    bool    find_new_groups ANSI((void));
  482. X# else
  483. X    long    birthof ANSI((char *,ART_NUM));
  484. X# endif
  485. X    bool    scanactive ANSI((void));
  486. X#endif
  487. END_OF_FILE
  488. if test 989 -ne `wc -c <'addng.h'`; then
  489.     echo shar: \"'addng.h'\" unpacked with wrong size!
  490. fi
  491. # end of 'addng.h'
  492. fi
  493. if test -f 'art.h' -a "${1}" != "-c" ; then 
  494.   echo shar: Will not clobber existing file \"'art.h'\"
  495. else
  496. echo shar: Extracting \"'art.h'\" \(963 characters\)
  497. sed "s/^X//" >'art.h' <<'END_OF_FILE'
  498. X/* $Id: art.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  499. X *
  500. X * $Log: art.h,v $
  501. X * Revision 4.4  1991/09/09  20:18:23  sob
  502. X * release 4.4
  503. X *
  504. X *
  505. X * 
  506. X */
  507. X/* This software is Copyright 1991 by Stan Barber. 
  508. X *
  509. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  510. X * use this software as long as: there is no monetary profit gained
  511. X * specifically from the use or reproduction of this software, it is not
  512. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  513. X * included prominently in any copy made. 
  514. X *
  515. X * The author make no claims as to the fitness or correctness of this software
  516. X * for any use whatsoever, and it is provided as is. Any use of this software
  517. X * is at the user's own risk. 
  518. X */
  519. X
  520. X/* do_article() return values */
  521. X
  522. X#define DA_NORM 0
  523. X#define DA_RAISE 1
  524. X#define DA_CLEAN 2
  525. X#define DA_TOEND 3
  526. X
  527. void    art_init ANSI((void));
  528. int    do_article ANSI((void));
  529. int    page_switch ANSI((void));
  530. bool    innermore ANSI((void));
  531. END_OF_FILE
  532. if test 963 -ne `wc -c <'art.h'`; then
  533.     echo shar: \"'art.h'\" unpacked with wrong size!
  534. fi
  535. # end of 'art.h'
  536. fi
  537. if test -f 'artio.h' -a "${1}" != "-c" ; then 
  538.   echo shar: Will not clobber existing file \"'artio.h'\"
  539. else
  540. echo shar: Extracting \"'artio.h'\" \(1662 characters\)
  541. sed "s/^X//" >'artio.h' <<'END_OF_FILE'
  542. X/* $Id: artio.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  543. X *
  544. X * $Log: artio.h,v $
  545. X * Revision 4.4  1991/09/09  20:18:23  sob
  546. X * release 4.4
  547. X *
  548. X *
  549. X * 
  550. X */
  551. X/* This software is Copyright 1991 by Stan Barber. 
  552. X *
  553. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  554. X * use this software as long as: there is no monetary profit gained
  555. X * specifically from the use or reproduction of this software, it is not
  556. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  557. X * included prominently in any copy made. 
  558. X *
  559. X * The author make no claims as to the fitness or correctness of this software
  560. X * for any use whatsoever, and it is provided as is. Any use of this software
  561. X * is at the user's own risk. 
  562. X */
  563. X
  564. XEXT ART_POS artpos INIT(0);    /* byte position in article file */
  565. X
  566. XEXT ART_LINE artline INIT(0);        /* current line number in article file */
  567. XEXT FILE *artfp INIT(Nullfp);        /* current article file pointer */
  568. XEXT ART_NUM openart INIT(0);        /* what is the currently open article number? */
  569. X#ifdef LINKART
  570. X    EXT char *linkartname INIT(nullstr);/* real name of article for Eunice */
  571. X#endif
  572. X#ifdef SERVER
  573. XEXT ART_PART openpart INIT(0);    /* how much of that article do we have? */
  574. XFILE    *nntpopen ANSI((ART_NUM,ART_PART));
  575. X                /* get an article unless already retrieved */
  576. void    nntpclose ANSI((void));
  577. X/* MUST be in increasing order of completeness! */
  578. X#define GET_STATUS    1        /* test for existence only */
  579. X#define GET_HEADER    2        /* if only header items are desired */
  580. X#define GET_ARTICLE    3        /* retreive full article  */
  581. X#endif
  582. X
  583. void    artio_init ANSI((void));
  584. XFILE    *artopen ANSI((ART_NUM));  /* open an article unless already opened */
  585. END_OF_FILE
  586. if test 1662 -ne `wc -c <'artio.h'`; then
  587.     echo shar: \"'artio.h'\" unpacked with wrong size!
  588. fi
  589. # end of 'artio.h'
  590. fi
  591. if test -f 'artsrch.h' -a "${1}" != "-c" ; then 
  592.   echo shar: Will not clobber existing file \"'artsrch.h'\"
  593. else
  594. echo shar: Extracting \"'artsrch.h'\" \(1608 characters\)
  595. sed "s/^X//" >'artsrch.h' <<'END_OF_FILE'
  596. X/* $Id: artsrch.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  597. X *
  598. X * $Log: artsrch.h,v $
  599. X * Revision 4.4  1991/09/09  20:18:23  sob
  600. X * release 4.4
  601. X *
  602. X *
  603. X * 
  604. X */
  605. X/* This software is Copyright 1991 by Stan Barber. 
  606. X *
  607. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  608. X * use this software as long as: there is no monetary profit gained
  609. X * specifically from the use or reproduction of this software, it is not
  610. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  611. X * included prominently in any copy made. 
  612. X *
  613. X * The author make no claims as to the fitness or correctness of this software
  614. X * for any use whatsoever, and it is provided as is. Any use of this software
  615. X * is at the user's own risk. 
  616. X */
  617. X
  618. X#ifndef NBRA
  619. X#include "search.h"
  620. X#endif
  621. X
  622. X#ifdef ARTSEARCH
  623. X
  624. X#define SRCH_ABORT 0
  625. X#define SRCH_INTR 1
  626. X#define SRCH_FOUND 2
  627. X#define SRCH_NOTFOUND 3
  628. X#define SRCH_DONE 4
  629. X#define SRCH_SUBJDONE 5
  630. X#define SRCH_ERROR 6
  631. X#endif
  632. X
  633. XEXT char *lastpat INIT(nullstr);    /* last search pattern */
  634. X#ifdef ARTSEARCH
  635. X    EXT COMPEX sub_compex;        /* last compiled subject search */
  636. X    EXT COMPEX art_compex;        /* last compiled normal search */
  637. X#   ifdef CONDSUB
  638. X    EXT COMPEX *bra_compex INIT(&(art_compex));
  639. X                    /* current compex with brackets */
  640. X#   endif
  641. X    EXT char art_howmuch;        /* search just the subjects */
  642. X    EXT bool art_doread;        /* search read articles? */
  643. X#endif
  644. X
  645. void    artsrch_init ANSI((void));
  646. X#ifdef ARTSEARCH
  647. X    int        art_search ANSI((char *, int, int));
  648. X    bool    wanted ANSI((COMPEX *, ART_NUM, char_int));
  649. X            /* return TRUE if current article matches pattern */
  650. X#endif
  651. END_OF_FILE
  652. if test 1608 -ne `wc -c <'artsrch.h'`; then
  653.     echo shar: \"'artsrch.h'\" unpacked with wrong size!
  654. fi
  655. # end of 'artsrch.h'
  656. fi
  657. if test -f 'artstate.h' -a "${1}" != "-c" ; then 
  658.   echo shar: Will not clobber existing file \"'artstate.h'\"
  659. else
  660. echo shar: Extracting \"'artstate.h'\" \(1512 characters\)
  661. sed "s/^X//" >'artstate.h' <<'END_OF_FILE'
  662. X/* $Id: artstate.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $ 
  663. X *
  664. X * $Log: artstate.h,v $
  665. X * Revision 4.4  1991/09/09  20:18:23  sob
  666. X * release 4.4
  667. X *
  668. X *
  669. X * 
  670. X */
  671. X/* This software is Copyright 1991 by Stan Barber. 
  672. X *
  673. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  674. X * use this software as long as: there is no monetary profit gained
  675. X * specifically from the use or reproduction of this software, it is not
  676. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  677. X * included prominently in any copy made. 
  678. X *
  679. X * The author make no claims as to the fitness or correctness of this software
  680. X * for any use whatsoever, and it is provided as is. Any use of this software
  681. X * is at the user's own risk. 
  682. X */
  683. X
  684. XEXT bool reread INIT(FALSE);        /* consider current art temporarily */
  685. X                    /* unread? */
  686. XEXT bool do_fseek INIT(FALSE);    /* should we back up in article file? */
  687. X
  688. XEXT bool oldsubject INIT(FALSE);    /* not 1st art in subject thread */
  689. XEXT ART_LINE topline INIT(-1);        /* top line of current screen */
  690. XEXT bool do_hiding INIT(TRUE);        /* hide header lines with -h? */
  691. X#ifdef ROTATION
  692. XEXT bool rotate INIT(FALSE);        /* has rotation been requested? */
  693. X#endif
  694. XEXT char *prompt;            /* pointer to current prompt */
  695. X
  696. XEXT char *firstline INIT(Nullch);            /* special first line? */
  697. X#ifdef CUSTOMLINES
  698. XEXT char *hideline INIT(Nullch);        /* custom line hiding? */
  699. XEXT char *pagestop INIT(Nullch);        /* custom page terminator? */
  700. XEXT COMPEX hide_compex;
  701. XEXT COMPEX page_compex;
  702. X#endif
  703. END_OF_FILE
  704. if test 1512 -ne `wc -c <'artstate.h'`; then
  705.     echo shar: \"'artstate.h'\" unpacked with wrong size!
  706. fi
  707. # end of 'artstate.h'
  708. fi
  709. if test -f 'autosub.c' -a "${1}" != "-c" ; then 
  710.   echo shar: Will not clobber existing file \"'autosub.c'\"
  711. else
  712. echo shar: Extracting \"'autosub.c'\" \(1964 characters\)
  713. sed "s/^X//" >'autosub.c' <<'END_OF_FILE'
  714. X/*
  715. X * $Id: autosub.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  716. X *
  717. X * $Log: autosub.c,v $
  718. X * Revision 4.4  1991/09/09  20:18:23  sob
  719. X * release 4.4
  720. X *
  721. X *
  722. X *
  723. X */
  724. X/* This software is Copyright 1991 by Stan Barber. 
  725. X *
  726. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  727. X * use this software as long as: there is no monetary profit gained
  728. X * specifically from the use or reproduction of this software, it is not
  729. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  730. X * included prominently in any copy made. 
  731. X *
  732. X * The author make no claims as to the fitness or correctness of this software
  733. X * for any use whatsoever, and it is provided as is. Any use of this software
  734. X * is at the user's own risk. 
  735. X */
  736. X
  737. X#include "EXTERN.h"
  738. X#include "common.h"
  739. X#include "search.h"
  740. X#include "ngsrch.h"
  741. X#include "util.h"
  742. X#include "INTERN.h"
  743. X#include "autosub.h"
  744. X
  745. X/* Consider the newsgroup specified, and return:    */
  746. X/* : if we should autosubscribe to it            */
  747. X/* ! if we should autounsubscribe to it            */
  748. X/* \0 if we should ask the user.            */
  749. int
  750. auto_subscribe(ng)
  751. char *ng;
  752. X{
  753. X    char *s;
  754. X
  755. X    if((s = getval("AUTOSUBSCRIBE", (char *)NULL))
  756. X    && matchlist(s, ng)) return ':';
  757. X    if((s = getval("AUTOUNSUBSCRIBE", (char *)NULL))
  758. X    && matchlist(s, ng)) return '!';
  759. X    return 0;
  760. X}
  761. X
  762. bool
  763. matchlist(patlist, s)
  764. char *patlist;
  765. char *s;
  766. X{
  767. X    COMPEX ilcompex;
  768. X    char *p;
  769. X    char *err;
  770. X    bool result;
  771. X    bool tmpresult;
  772. X
  773. X    result = FALSE;
  774. X    init_compex(&ilcompex);
  775. X    while(patlist && *patlist) {
  776. X
  777. X    if(*patlist == '!') {
  778. X        patlist++;
  779. X        tmpresult = FALSE;
  780. X    } else tmpresult = TRUE;
  781. X
  782. X    if(p = index(patlist, ',')) *p = '\0';
  783. X        /* compile regular expression */
  784. X    err = ng_comp(&ilcompex,patlist,TRUE,TRUE);
  785. X    if(p) *p++ = ',';
  786. X
  787. X    if(err != Nullch) {
  788. X        printf("\n%s\n", err) FLUSH;
  789. X        finalize(1);
  790. X    }
  791. X    
  792. X    if (execute(&ilcompex,s) != Nullch)
  793. X        result = tmpresult;
  794. X    patlist = p;
  795. X    }
  796. X    free_compex(&ilcompex);
  797. X    return result;
  798. X}
  799. END_OF_FILE
  800. if test 1964 -ne `wc -c <'autosub.c'`; then
  801.     echo shar: \"'autosub.c'\" unpacked with wrong size!
  802. fi
  803. # end of 'autosub.c'
  804. fi
  805. if test -f 'autosub.h' -a "${1}" != "-c" ; then 
  806.   echo shar: Will not clobber existing file \"'autosub.h'\"
  807. else
  808. echo shar: Extracting \"'autosub.h'\" \(829 characters\)
  809. sed "s/^X//" >'autosub.h' <<'END_OF_FILE'
  810. X/*
  811. X * $Id: autosub.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  812. X *
  813. X * $Log: autosub.h,v $
  814. X * Revision 4.4  1991/09/09  20:18:23  sob
  815. X * release 4.4
  816. X *
  817. X *
  818. X *
  819. X */
  820. X/* This software is Copyright 1991 by Stan Barber. 
  821. X *
  822. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  823. X * use this software as long as: there is no monetary profit gained
  824. X * specifically from the use or reproduction of this software, it is not
  825. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  826. X * included prominently in any copy made. 
  827. X *
  828. X * The author make no claims as to the fitness or correctness of this software
  829. X * for any use whatsoever, and it is provided as is. Any use of this software
  830. X * is at the user's own risk. 
  831. X */
  832. X
  833. XEXT int autosubscribe ANSI((char *));
  834. XEXT bool matchlist  ANSI((char *, char *));
  835. END_OF_FILE
  836. if test 829 -ne `wc -c <'autosub.h'`; then
  837.     echo shar: \"'autosub.h'\" unpacked with wrong size!
  838. fi
  839. # end of 'autosub.h'
  840. fi
  841. if test -f 'backpage.h' -a "${1}" != "-c" ; then 
  842.   echo shar: Will not clobber existing file \"'backpage.h'\"
  843. else
  844. echo shar: Extracting \"'backpage.h'\" \(1133 characters\)
  845. sed "s/^X//" >'backpage.h' <<'END_OF_FILE'
  846. X/* $Id: backpage.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  847. X *
  848. X * $Log: backpage.h,v $
  849. X * Revision 4.4  1991/09/09  20:18:23  sob
  850. X * release 4.4
  851. X *
  852. X *
  853. X * 
  854. X */
  855. X/* This software is Copyright 1991 by Stan Barber. 
  856. X *
  857. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  858. X * use this software as long as: there is no monetary profit gained
  859. X * specifically from the use or reproduction of this software, it is not
  860. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  861. X * included prominently in any copy made. 
  862. X *
  863. X * The author make no claims as to the fitness or correctness of this software
  864. X * for any use whatsoever, and it is provided as is. Any use of this software
  865. X * is at the user's own risk. 
  866. X */
  867. X
  868. X/* things for doing the 'back page' command */
  869. X
  870. XEXT int varyfd INIT(0);            /* virtual array file for storing  */
  871. X                    /* file offsets */
  872. XEXT ART_POS varybuf[VARYSIZE];        /* current window onto virtual array */
  873. X
  874. XEXT long oldoffset INIT(-1);        /* offset to block currently in window */
  875. X
  876. void    backpage_init ANSI((void));
  877. ART_POS    vrdary ANSI((ART_LINE));
  878. void    vwtary ANSI((ART_LINE,ART_POS));
  879. END_OF_FILE
  880. if test 1133 -ne `wc -c <'backpage.h'`; then
  881.     echo shar: \"'backpage.h'\" unpacked with wrong size!
  882. fi
  883. # end of 'backpage.h'
  884. fi
  885. if test -f 'cheat.h' -a "${1}" != "-c" ; then 
  886.   echo shar: Will not clobber existing file \"'cheat.h'\"
  887. else
  888. echo shar: Extracting \"'cheat.h'\" \(1051 characters\)
  889. sed "s/^X//" >'cheat.h' <<'END_OF_FILE'
  890. X/* $Id: cheat.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  891. X *
  892. X * $Log: cheat.h,v $
  893. X * Revision 4.4  1991/09/09  20:18:23  sob
  894. X * release 4.4
  895. X *
  896. X * 
  897. X */
  898. X/* This software is Copyright 1991 by Stan Barber. 
  899. X *
  900. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  901. X * use this software as long as: there is no monetary profit gained
  902. X * specifically from the use or reproduction of this software, it is not
  903. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  904. X * included prominently in any copy made. 
  905. X *
  906. X * The author make no claims as to the fitness or correctness of this software
  907. X * for any use whatsoever, and it is provided as is. Any use of this software
  908. X * is at the user's own risk. 
  909. X */
  910. X
  911. X#ifdef ARTSEARCH
  912. XEXT ART_NUM srchahead INIT(0);     /* are we in subject scan mode? */
  913. X                /* (if so, contains art # found or -1) */
  914. X#endif
  915. X
  916. X#ifdef PENDING
  917. X#   ifdef CACHESUBJ
  918. X    EXT ART_NUM subj_to_get;
  919. X#   endif
  920. X#endif
  921. X
  922. void    cheat_init ANSI((void));
  923. void    look_ahead ANSI((void));
  924. void    collect_subjects ANSI((void));
  925. END_OF_FILE
  926. if test 1051 -ne `wc -c <'cheat.h'`; then
  927.     echo shar: \"'cheat.h'\" unpacked with wrong size!
  928. fi
  929. # end of 'cheat.h'
  930. fi
  931. if test -f 'decode.c' -a "${1}" != "-c" ; then 
  932.   echo shar: Will not clobber existing file \"'decode.c'\"
  933. else
  934. echo shar: Extracting \"'decode.c'\" \(471 characters\)
  935. sed "s/^X//" >'decode.c' <<'END_OF_FILE'
  936. X/* $Id: decode.c,v 4.4.3.1 1991/11/22 04:12:25 davison Trn $
  937. X *
  938. X * $Log: decode.c,v $
  939. X * Revision 4.4.3.1  1991/11/22  04:12:25  davison
  940. X * Trn Release 2.0
  941. X *
  942. X */
  943. X
  944. X#include "EXTERN.h"
  945. X#include "common.h"
  946. X#include "INTERN.h"
  947. X#include "decode.h"
  948. X
  949. void
  950. decode_init()
  951. X{
  952. X    unship_init();
  953. X}
  954. X
  955. void
  956. decode_end()
  957. X{
  958. X    if (decode_fp != Nullfp) {
  959. X    fclose(decode_fp);
  960. X    decode_fp = Nullfp;
  961. X    printf("\n%s INCOMPLETE -- removed.\n", decode_dest) FLUSH;
  962. X    unlink(decode_dest);
  963. X    }
  964. X}
  965. END_OF_FILE
  966. if test 471 -ne `wc -c <'decode.c'`; then
  967.     echo shar: \"'decode.c'\" unpacked with wrong size!
  968. fi
  969. # end of 'decode.c'
  970. fi
  971. if test -f 'decode.h' -a "${1}" != "-c" ; then 
  972.   echo shar: Will not clobber existing file \"'decode.h'\"
  973. else
  974. echo shar: Extracting \"'decode.h'\" \(1090 characters\)
  975. sed "s/^X//" >'decode.h' <<'END_OF_FILE'
  976. X/* $Id: decode.h,v 4.4.3.1 1991/11/22 04:12:25 davison Trn $
  977. X *
  978. X * $Log: decode.h,v $
  979. X * Revision 4.4  1991/09/09  20:27:37  sob
  980. X * release 4.4
  981. X *
  982. X *
  983. X * 
  984. X */
  985. X
  986. X/* This software is Copyright 1991 by Stan Barber. 
  987. X *
  988. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  989. X * use this software as long as: there is no monetary profit gained
  990. X * specifically from the use or reproduction of this software, it is not
  991. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  992. X * included prominently in any copy made. 
  993. X *
  994. X * The author make no claims as to the fitness or correctness of this software
  995. X * for any use whatsoever, and it is provided as is. Any use of this software
  996. X * is at the user's own risk. 
  997. X */
  998. XEXT FILE *decode_fp INIT(NULL);
  999. XEXT char decode_fname[MAXFILENAME];
  1000. XEXT char decode_dest[MAXFILENAME];
  1001. XEXT int decode_type;
  1002. X
  1003. void decode_init ANSI((void));
  1004. void decode_end ANSI((void));
  1005. X
  1006. void uud_start ANSI((void));
  1007. int uudecode ANSI((FILE *));
  1008. X
  1009. void unship_init ANSI((void));
  1010. int unship ANSI((FILE *));
  1011. X
  1012. X#define UUDECODE 0
  1013. X#define UNSHIP   1
  1014. END_OF_FILE
  1015. if test 1090 -ne `wc -c <'decode.h'`; then
  1016.     echo shar: \"'decode.h'\" unpacked with wrong size!
  1017. fi
  1018. # end of 'decode.h'
  1019. fi
  1020. if test -f 'final.h' -a "${1}" != "-c" ; then 
  1021.   echo shar: Will not clobber existing file \"'final.h'\"
  1022. else
  1023. echo shar: Extracting \"'final.h'\" \(1428 characters\)
  1024. sed "s/^X//" >'final.h' <<'END_OF_FILE'
  1025. X/* $Id: final.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1026. X * 
  1027. X * $Log: final.h,v $
  1028. X * Revision 4.4  1991/09/09  20:18:23  sob
  1029. X * release 4.4
  1030. X *
  1031. X *
  1032. X * 
  1033. X */
  1034. X/* This software is Copyright 1991 by Stan Barber. 
  1035. X *
  1036. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1037. X * use this software as long as: there is no monetary profit gained
  1038. X * specifically from the use or reproduction of this software, it is not
  1039. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1040. X * included prominently in any copy made. 
  1041. X *
  1042. X * The author make no claims as to the fitness or correctness of this software
  1043. X * for any use whatsoever, and it is provided as is. Any use of this software
  1044. X * is at the user's own risk. 
  1045. X */
  1046. X
  1047. X/* cleanup status for fast exits */
  1048. X
  1049. XEXT bool panic INIT(FALSE);        /* we got hung up or something-- */
  1050. X                    /*  so leave tty alone */
  1051. XEXT bool rc_changed INIT(FALSE);    /* need we rewrite .newsrc? */
  1052. XEXT bool doing_ng INIT(FALSE);        /* do we need to reconstitute */
  1053. X                    /* current rc line? */
  1054. X
  1055. XEXT char int_count INIT(0);        /* how many interrupts we've had */
  1056. X
  1057. XEXT bool clear_on_stop INIT(FALSE);    /* set when handling the stop signal */
  1058. X                    /* would leave the screen a mess */
  1059. X
  1060. X/* signal catching routines */
  1061. X
  1062. SIGRET    int_catcher ANSI((void));
  1063. SIGRET    sig_catcher ANSI((int));
  1064. X#ifdef SIGTSTP
  1065. X SIGRET    stop_catcher ANSI((int));
  1066. X#endif
  1067. X
  1068. void    final_init ANSI((void));
  1069. void    finalize ANSI((int));
  1070. END_OF_FILE
  1071. if test 1428 -ne `wc -c <'final.h'`; then
  1072.     echo shar: \"'final.h'\" unpacked with wrong size!
  1073. fi
  1074. # end of 'final.h'
  1075. fi
  1076. if test -f 'help.h' -a "${1}" != "-c" ; then 
  1077.   echo shar: Will not clobber existing file \"'help.h'\"
  1078. else
  1079. echo shar: Extracting \"'help.h'\" \(962 characters\)
  1080. sed "s/^X//" >'help.h' <<'END_OF_FILE'
  1081. X/* $Id: help.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1082. X *
  1083. X * $Log: help.h,v $
  1084. X * Revision 4.4  1991/09/09  20:18:23  sob
  1085. X * release 4.4
  1086. X *
  1087. X *
  1088. X * 
  1089. X */
  1090. X/* This software is Copyright 1991 by Stan Barber. 
  1091. X *
  1092. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1093. X * use this software as long as: there is no monetary profit gained
  1094. X * specifically from the use or reproduction of this software, it is not
  1095. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1096. X * included prominently in any copy made. 
  1097. X *
  1098. X * The author make no claims as to the fitness or correctness of this software
  1099. X * for any use whatsoever, and it is provided as is. Any use of this software
  1100. X * is at the user's own risk. 
  1101. X */
  1102. X
  1103. void    help_init ANSI((void));
  1104. int    help_ng ANSI((void));
  1105. int    help_art ANSI((void));
  1106. int    help_page ANSI((void));
  1107. X#ifdef ESCSUBS
  1108. X    int    help_subs ANSI((void));
  1109. X#endif
  1110. X#ifdef USETHREADS
  1111. X    int help_select ANSI((void));
  1112. X#endif
  1113. END_OF_FILE
  1114. if test 962 -ne `wc -c <'help.h'`; then
  1115.     echo shar: \"'help.h'\" unpacked with wrong size!
  1116. fi
  1117. # end of 'help.h'
  1118. fi
  1119. if test -f 'init.h' -a "${1}" != "-c" ; then 
  1120.   echo shar: Will not clobber existing file \"'init.h'\"
  1121. else
  1122. echo shar: Extracting \"'init.h'\" \(875 characters\)
  1123. sed "s/^X//" >'init.h' <<'END_OF_FILE'
  1124. X/* $Id: init.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1125. X *
  1126. X * $Log: init.h,v $
  1127. X * Revision 4.4  1991/09/09  20:18:23  sob
  1128. X * release 4.4
  1129. X *
  1130. X *
  1131. X * 
  1132. X */
  1133. X/* This software is Copyright 1991 by Stan Barber. 
  1134. X *
  1135. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1136. X * use this software as long as: there is no monetary profit gained
  1137. X * specifically from the use or reproduction of this software, it is not
  1138. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1139. X * included prominently in any copy made. 
  1140. X *
  1141. X * The author make no claims as to the fitness or correctness of this software
  1142. X * for any use whatsoever, and it is provided as is. Any use of this software
  1143. X * is at the user's own risk. 
  1144. X */
  1145. X
  1146. XEXT char *lockname INIT(nullstr);
  1147. X
  1148. bool    initialize ANSI((int,char **));
  1149. void    lock_check ANSI((void));
  1150. void    newsnews_check ANSI((void));
  1151. END_OF_FILE
  1152. if test 875 -ne `wc -c <'init.h'`; then
  1153.     echo shar: \"'init.h'\" unpacked with wrong size!
  1154. fi
  1155. # end of 'init.h'
  1156. fi
  1157. if test -f 'intrp.h' -a "${1}" != "-c" ; then 
  1158.   echo shar: Will not clobber existing file \"'intrp.h'\"
  1159. else
  1160. echo shar: Extracting \"'intrp.h'\" \(1569 characters\)
  1161. sed "s/^X//" >'intrp.h' <<'END_OF_FILE'
  1162. X/* $Id: intrp.h,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  1163. X *
  1164. X * $Log: intrp.h,v $
  1165. X * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  1166. X * Patchlevel 2 changes
  1167. X *
  1168. X * Revision 4.4  1991/09/09  20:18:23  sob
  1169. X * release 4.4
  1170. X *
  1171. X *
  1172. X * 
  1173. X */
  1174. X/* This software is Copyright 1991 by Stan Barber. 
  1175. X *
  1176. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1177. X * use this software as long as: there is no monetary profit gained
  1178. X * specifically from the use or reproduction of this software, it is not
  1179. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1180. X * included prominently in any copy made. 
  1181. X *
  1182. X * The author make no claims as to the fitness or correctness of this software
  1183. X * for any use whatsoever, and it is provided as is. Any use of this software
  1184. X * is at the user's own risk. 
  1185. X */
  1186. X
  1187. XEXT char *lib INIT(Nullch);        /* news library */
  1188. XEXT char *rnlib INIT(Nullch);        /* private news program library */
  1189. XEXT char *origdir INIT(Nullch);        /* cwd when rn invoked */
  1190. XEXT char *homedir INIT(Nullch);        /* login directory */
  1191. XEXT char *dotdir INIT(Nullch);        /* where . files go */
  1192. XEXT char *logname INIT(Nullch);        /* login id */
  1193. XEXT char *sitename INIT(Nullch);    /* host name */
  1194. XEXT int perform_cnt;
  1195. X
  1196. X#ifdef NEWSADMIN
  1197. X    EXT char newsadmin[] INIT(NEWSADMIN);/* news administrator */
  1198. X    EXT int newsuid INIT(0);
  1199. X#endif
  1200. X
  1201. void    intrp_init ANSI((char *));
  1202. char    *filexp ANSI((char *));
  1203. char    *dointerp ANSI((char *,int,char *,char *));
  1204. void    interp ANSI((char *,int,char *));
  1205. void    refscpy ANSI((char *,int,char *));
  1206. char    *getrealname ANSI((long));
  1207. END_OF_FILE
  1208. if test 1569 -ne `wc -c <'intrp.h'`; then
  1209.     echo shar: \"'intrp.h'\" unpacked with wrong size!
  1210. fi
  1211. # end of 'intrp.h'
  1212. fi
  1213. if test -f 'kfile.h' -a "${1}" != "-c" ; then 
  1214.   echo shar: Will not clobber existing file \"'kfile.h'\"
  1215. else
  1216. echo shar: Extracting \"'kfile.h'\" \(1202 characters\)
  1217. sed "s/^X//" >'kfile.h' <<'END_OF_FILE'
  1218. X/* $Id: kfile.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1219. X *
  1220. X * $Log: kfile.h,v $
  1221. X * Revision 4.4  1991/09/09  20:18:23  sob
  1222. X * release 4.4
  1223. X *
  1224. X *
  1225. X * 
  1226. X */
  1227. X/* This software is Copyright 1991 by Stan Barber. 
  1228. X *
  1229. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1230. X * use this software as long as: there is no monetary profit gained
  1231. X * specifically from the use or reproduction of this software, it is not
  1232. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1233. X * included prominently in any copy made. 
  1234. X *
  1235. X * The author make no claims as to the fitness or correctness of this software
  1236. X * for any use whatsoever, and it is provided as is. Any use of this software
  1237. X * is at the user's own risk. 
  1238. X */
  1239. X
  1240. X#define KF_GLOBAL 0
  1241. X#define KF_LOCAL 1
  1242. X
  1243. X#ifdef KILLFILES
  1244. XEXT FILE *globkfp INIT(Nullfp);        /* global article killer file */
  1245. XEXT FILE *localkfp INIT(Nullfp);    /* local (for this newsgroup) */
  1246. X                    /*  article killer file */
  1247. X#endif
  1248. X
  1249. void    kfile_init ANSI((void));
  1250. int    do_kfile ANSI((FILE *,int));
  1251. void    kill_unwanted ANSI((ART_NUM,char *,int));
  1252. int    edit_kfile ANSI((void));
  1253. void    open_kfile ANSI((int));
  1254. void    kf_append ANSI((char *));
  1255. void    setthru ANSI((ART_NUM));
  1256. END_OF_FILE
  1257. if test 1202 -ne `wc -c <'kfile.h'`; then
  1258.     echo shar: \"'kfile.h'\" unpacked with wrong size!
  1259. fi
  1260. # end of 'kfile.h'
  1261. fi
  1262. if test -f 'last.h' -a "${1}" != "-c" ; then 
  1263.   echo shar: Will not clobber existing file \"'last.h'\"
  1264. else
  1265. echo shar: Extracting \"'last.h'\" \(1175 characters\)
  1266. sed "s/^X//" >'last.h' <<'END_OF_FILE'
  1267. X/* $Id: last.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1268. X *
  1269. X * $Log: last.h,v $
  1270. X * Revision 4.4  1991/09/09  20:23:31  sob
  1271. X * release 4.4
  1272. X *
  1273. X *
  1274. X * 
  1275. X */
  1276. X/* This software is Copyright 1991 by Stan Barber. 
  1277. X *
  1278. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1279. X * use this software as long as: there is no monetary profit gained
  1280. X * specifically from the use or reproduction of this software, it is not
  1281. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1282. X * included prominently in any copy made. 
  1283. X *
  1284. X * The author make no claims as to the fitness or correctness of this software
  1285. X * for any use whatsoever, and it is provided as is. Any use of this software
  1286. X * is at the user's own risk. 
  1287. X */
  1288. X
  1289. XEXT char *lastngname INIT(Nullch);    /* last newsgroup read, from .rnlast file */
  1290. XEXT long lasttime INIT(0);    /* time last rn was started up */
  1291. XEXT long lastactsiz INIT(0);    /* size of active file when rn last started up */
  1292. XEXT long lastnewtime INIT(0);    /* time last new group was found */
  1293. XEXT long lastnewsize INIT(0);    /* size of active.times file when rn last started up */
  1294. X
  1295. void    last_init ANSI((char *));
  1296. void    writelast ANSI((void));
  1297. END_OF_FILE
  1298. if test 1175 -ne `wc -c <'last.h'`; then
  1299.     echo shar: \"'last.h'\" unpacked with wrong size!
  1300. fi
  1301. # end of 'last.h'
  1302. fi
  1303. if test -f 'makedir.SH' -a "${1}" != "-c" ; then 
  1304.   echo shar: Will not clobber existing file \"'makedir.SH'\"
  1305. else
  1306. echo shar: Extracting \"'makedir.SH'\" \(1644 characters\)
  1307. sed "s/^X//" >'makedir.SH' <<'END_OF_FILE'
  1308. case $CONFIG in
  1309. X    '') . ./config.sh ;;
  1310. esac
  1311. echo "Extracting makedir (with variable substitutions)"
  1312. X$spitshell >makedir <<!GROK!THIS!
  1313. X$startsh
  1314. X# $Id: makedir.SH,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1315. X# 
  1316. X# $Log: makedir.SH,v $
  1317. X# Revision 4.4  1991/09/09  20:23:31  sob
  1318. X# release 4.4
  1319. X#
  1320. X#
  1321. X# 
  1322. X# This software is Copyright 1991 by Stan Barber. 
  1323. X#
  1324. X# Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1325. X# use this software as long as: there is no monetary profit gained
  1326. X# specifically from the use or reproduction or this software, it is not
  1327. X# sold, rented, traded or otherwise marketed, and this copyright notice is
  1328. X# included prominently in any copy made. 
  1329. X#
  1330. X# The author make no claims as to the fitness or correctness of this software
  1331. X# for any use whatsoever, and it is provided as is. Any use of this software
  1332. X# is at the user's own risk. 
  1333. X
  1334. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1335. X
  1336. case \$# in
  1337. X  0)
  1338. X    $echo "makedir pathname filenameflag"
  1339. X    exit 1
  1340. X    ;;
  1341. esac
  1342. X
  1343. X: guarantee one slash before 1st component
  1344. case \$1 in
  1345. X  /*) ;;
  1346. X  *)  set ./\$1 \$2 ;;
  1347. esac
  1348. X
  1349. X: strip last component if it is to be a filename
  1350. case X\$2 in
  1351. X  X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
  1352. X  *)  set \$1 ;;
  1353. esac
  1354. X
  1355. X: return reasonable status if nothing to be created
  1356. if $test -d "\$1" ; then
  1357. X    exit 0
  1358. fi
  1359. X
  1360. list=''
  1361. while true ; do
  1362. X    case \$1 in
  1363. X    */*)
  1364. X    list="\$1 \$list"
  1365. X    set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\`
  1366. X    ;;
  1367. X    *)
  1368. X    break
  1369. X    ;;
  1370. X    esac
  1371. done
  1372. X
  1373. set \$list
  1374. X
  1375. for dir do
  1376. X    $mkdir \$dir >/dev/null 2>&1
  1377. done
  1378. X!GROK!THIS!
  1379. X$eunicefix makedir
  1380. chmod 755 makedir
  1381. END_OF_FILE
  1382. if test 1644 -ne `wc -c <'makedir.SH'`; then
  1383.     echo shar: \"'makedir.SH'\" unpacked with wrong size!
  1384. fi
  1385. # end of 'makedir.SH'
  1386. fi
  1387. if test -f 'mbox.saver.SH' -a "${1}" != "-c" ; then 
  1388.   echo shar: Will not clobber existing file \"'mbox.saver.SH'\"
  1389. else
  1390. echo shar: Extracting \"'mbox.saver.SH'\" \(1846 characters\)
  1391. sed "s/^X//" >'mbox.saver.SH' <<'END_OF_FILE'
  1392. case $CONFIG in
  1393. X    '') . ./config.sh ;;
  1394. esac
  1395. echo "Extracting mbox.saver (with variable substitutions)"
  1396. X$spitshell >mbox.saver <<!GROK!THIS!
  1397. X$startsh
  1398. X# $Id: mbox.saver.SH,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1399. X# 
  1400. X# $Log: mbox.saver.SH,v $
  1401. X# Revision 4.4  1991/09/09  20:23:31  sob
  1402. X# release 4.4
  1403. X#
  1404. X# 
  1405. X# This software is Copyright 1991 by Stan Barber. 
  1406. X#
  1407. X# Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1408. X# use this software as long as: there is no monetary profit gained
  1409. X# specifically from the use or reproduction of this software, it is not
  1410. X# sold, rented, traded or otherwise marketed, and this copyright notice is
  1411. X# included prominently in any copy made. 
  1412. X#
  1413. X# The author make no claims as to the fitness or correctness of this software
  1414. X# for any use whatsoever, and it is provided as is. Any use of this software
  1415. X# is at the user's own risk. 
  1416. X# 
  1417. X#    Arguments:
  1418. X#    1 Full name of article (%A)
  1419. X#    2 Public news spool directory (%P)
  1420. X#    3 Directory of current newsgroup (%c)
  1421. X#    4 Article number (%a)
  1422. X#    5 Where in article to start (%B)
  1423. X#    6 Newsgroup name (%C)
  1424. X#    7 Save destination (%b)
  1425. X#    8 First line of message, normally From...
  1426. X#
  1427. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1428. X
  1429. X!GROK!THIS!
  1430. case $mboxchar in
  1431. X"$CTRLA")
  1432. X    $spitshell >>mbox.saver <<!GROK!THIS!
  1433. X( $echo "$CTRLA$CTRLA$CTRLA$CTRLA"
  1434. X  if $test "\$5" = 0 -a ! "\$4" = 0 ; then
  1435. X    $echo "Article: \$4 of \$6"
  1436. X  fi
  1437. X  $tail +\$5c \$1
  1438. X  $echo ""
  1439. X  $echo ""
  1440. X  $echo "$CTRLA$CTRLA$CTRLA$CTRLA" ) >> \$7
  1441. X!GROK!THIS!
  1442. X    ;;
  1443. X*)
  1444. X    $spitshell >>mbox.saver <<!GROK!THIS!
  1445. X ( $echo "\$8"
  1446. X  if $test "\$5" = 0 -a ! "\$4" = 0 ; then
  1447. X    $echo "Article: \$4 of \$6"
  1448. X  fi
  1449. X  $tail +\$5c \$1 | $sed "s/^From />From /"
  1450. X  $echo ""
  1451. X  $echo "" ) >> \$7
  1452. X!GROK!THIS!
  1453. X    ;;
  1454. esac
  1455. X$eunicefix mbox.saver
  1456. chmod 755 mbox.saver
  1457. END_OF_FILE
  1458. if test 1846 -ne `wc -c <'mbox.saver.SH'`; then
  1459.     echo shar: \"'mbox.saver.SH'\" unpacked with wrong size!
  1460. fi
  1461. # end of 'mbox.saver.SH'
  1462. fi
  1463. if test -f 'mt-lint.h' -a "${1}" != "-c" ; then 
  1464.   echo shar: Will not clobber existing file \"'mt-lint.h'\"
  1465. else
  1466. echo shar: Extracting \"'mt-lint.h'\" \(1452 characters\)
  1467. sed "s/^X//" >'mt-lint.h' <<'END_OF_FILE'
  1468. X/* $Id: mt-lint.h,v 4.4.3.1 1991/11/22 04:12:15 davison Trn $
  1469. X**
  1470. X** $Log: mt-lint.h,v $
  1471. X** Revision 4.4.3.1  1991/11/22  04:12:15  davison
  1472. X** Trn Release 2.0
  1473. X** 
  1474. X** Handle brain-dead lints that only have 6 significant-character names.
  1475. X*/
  1476. X
  1477. X#define subject_cnts        sucnts
  1478. X#define subject_array        suarra
  1479. X#define subject_strings        sustri
  1480. X#define subject_str        sustr
  1481. X#define author_cnts        aucnts
  1482. X#define author_array        auarra
  1483. X#define author_root        auroot
  1484. X#define author_str        austr
  1485. X#define valid_subject        vsubje
  1486. X#define valid_author        vautho
  1487. X#define valid_message_id    vmsgid
  1488. X#define read_authors        rautho
  1489. X#define read_articles        rartic
  1490. X#define read_ids        rids
  1491. X#define read_item        ritem
  1492. X#define processed_groups    pgroup
  1493. X#define process_articles    partic
  1494. X#define expired_articles    eartic
  1495. X#define unlink_child        uchild
  1496. X#define unlink_root        uroot
  1497. X#define free_article        fartic
  1498. X#define free_author        fautho
  1499. X#define enumerate_articles    enarti
  1500. X#define enumerate_thread    enthrd
  1501. X#define string_offset        soffst
  1502. X#define write_authors        wautho
  1503. X#define write_subjects        wsubje
  1504. X#define write_roots        wroots
  1505. X#define write_articles        wartic
  1506. X#define write_thread        wthred
  1507. X#define write_ids        wids
  1508. X#define write_item        witem
  1509. X#define processed_groups    pgroup
  1510. X#define timer_off        timoff
  1511. X#define timer_first        tim1st
  1512. X#define timer_next        timnxt
  1513. X#define truncate_len        trulen
  1514. X#define article_array        artarr
  1515. X
  1516. X#define safemalloc(x)    (NULL)
  1517. X#define free(x)        (x = NULL)
  1518. X#define safefree(x)    (*x = NULL)
  1519. X#define signal(x,y)
  1520. END_OF_FILE
  1521. if test 1452 -ne `wc -c <'mt-lint.h'`; then
  1522.     echo shar: \"'mt-lint.h'\" unpacked with wrong size!
  1523. fi
  1524. # end of 'mt-lint.h'
  1525. fi
  1526. if test -f 'mt.check.SH' -a "${1}" != "-c" ; then 
  1527.   echo shar: Will not clobber existing file \"'mt.check.SH'\"
  1528. else
  1529. echo shar: Extracting \"'mt.check.SH'\" \(1376 characters\)
  1530. sed "s/^X//" >'mt.check.SH' <<'END_OF_FILE'
  1531. case $CONFIG in
  1532. X    '') . ./config.sh ;;
  1533. esac
  1534. echo "Extracting mt.check (with variable substitutions)"
  1535. version=`cat patchlevel`
  1536. X$spitshell >mt.check <<!GROK!THIS!
  1537. X$startsh
  1538. X# $Id: mt.check.SH,v 4.4.3.1 1991/11/22 04:11:10 davison Trn $
  1539. X#
  1540. X# $Log:    mt.check.SH,v $
  1541. X# Revision 4.4.3.1  1991/11/22  04:11:10  davison
  1542. X# Trn Release 2.0
  1543. X# 
  1544. X# mt.check - daily maintenance for mt.log
  1545. X# 
  1546. X# Check mt.log for earth-shattering errors, and mail them to \$gurus if found.
  1547. X# Then move the mt.log file into a week-long history chain.
  1548. X#
  1549. X# Usage: mt.check
  1550. X#
  1551. X
  1552. gurus="$newsadmin"
  1553. tmp="/tmp/mt.c\$\$"
  1554. X
  1555. PATH=/bin:/usr/bin
  1556. export PATH
  1557. X
  1558. umask 002
  1559. X
  1560. trap "rm -f \$tmp ; exit 0" 0 1 2 15
  1561. X
  1562. cd $mtlib
  1563. X
  1564. X$egrep " \\*\\*\$" mt.log >\$tmp
  1565. X
  1566. if test -s \$tmp ; then
  1567. X    (cat <<EOT
  1568. To: \$gurus
  1569. Subject: mthreads error!
  1570. X
  1571. The following errors were reported in mt.log.  If the error pertains to
  1572. the active file,  you should lock down your news system and fix it.  If
  1573. it is a thread-releated bug and it persists, please report this fact to
  1574. Wayne Davison (davison@borland.com).  Mention version "$version".
  1575. X
  1576. XEOT
  1577. X    cat \$tmp) | mail \$gurus
  1578. fi
  1579. X
  1580. test -f mt.log.6 && mv mt.log.6 mt.log.7
  1581. test -f mt.log.5 && mv mt.log.5 mt.log.6
  1582. test -f mt.log.4 && mv mt.log.4 mt.log.5
  1583. test -f mt.log.3 && mv mt.log.3 mt.log.4
  1584. test -f mt.log.2 && mv mt.log.2 mt.log.3
  1585. test -f mt.log   && mv mt.log   mt.log.2
  1586. touch mt.log
  1587. X
  1588. exit 0
  1589. X!GROK!THIS!
  1590. END_OF_FILE
  1591. if test 1376 -ne `wc -c <'mt.check.SH'`; then
  1592.     echo shar: \"'mt.check.SH'\" unpacked with wrong size!
  1593. fi
  1594. # end of 'mt.check.SH'
  1595. fi
  1596. if test -f 'mthreads.h' -a "${1}" != "-c" ; then 
  1597.   echo shar: Will not clobber existing file \"'mthreads.h'\"
  1598. else
  1599. echo shar: Extracting \"'mthreads.h'\" \(1630 characters\)
  1600. sed "s/^X//" >'mthreads.h' <<'END_OF_FILE'
  1601. X/* $Id: mthreads.h,v 4.4.3.1 1991/11/22 04:12:15 davison Trn $
  1602. X**
  1603. X** $Log: mthreads.h,v $
  1604. X** Revision 4.4.3.1  1991/11/22  04:12:15  davison
  1605. X** Trn Release 2.0
  1606. X** 
  1607. X*/
  1608. X
  1609. X#ifdef lint
  1610. X#include "mt-lint.h"
  1611. X#endif
  1612. X
  1613. X#if !defined(TMPTHREAD) && defined(SERVERSPOOL)
  1614. X# undef SERVER
  1615. X# undef SPOOL
  1616. X# define SPOOL SERVERSPOOL
  1617. X#endif
  1618. X
  1619. X#define RWBUFSIZ 8192
  1620. X
  1621. X#define PASS_LOCK 1
  1622. X#define DAEMON_LOCK 2
  1623. X
  1624. XEXT char rwbuf[RWBUFSIZ];
  1625. X
  1626. XEXT TOTAL total;
  1627. X
  1628. XEXT int added_articles INIT(0);
  1629. XEXT int expired_articles INIT(0);
  1630. XEXT int added_count;
  1631. XEXT int expired_count;
  1632. XEXT bool extra_expire INIT(FALSE);
  1633. X
  1634. XEXT char *strings INIT(0);
  1635. XEXT WORD *subject_cnts INIT(0);
  1636. XEXT WORD *author_cnts INIT(0);
  1637. XEXT WORD *ids INIT(0);
  1638. X
  1639. XEXT SUBJECT **subject_array;
  1640. XEXT ROOT **root_array;
  1641. XEXT AUTHOR **author_array;
  1642. XEXT ARTICLE **article_array;
  1643. X
  1644. XEXT PACKED_ROOT p_root;
  1645. XEXT PACKED_ARTICLE p_article;
  1646. X
  1647. XEXT ROOT *root_root;
  1648. XEXT AUTHOR *author_root;
  1649. X
  1650. X#ifndef DOINIT
  1651. XEXT DOMAIN unk_domain;
  1652. X#else
  1653. DOMAIN unk_domain = {
  1654. X    ".unknown.", NULL, NULL
  1655. X};
  1656. X#endif
  1657. X
  1658. int ngmatch ANSI((char *,char *));
  1659. int onepatmatch ANSI((char *,char *));
  1660. X
  1661. void mt_init ANSI((void));
  1662. long mt_lock ANSI((int, int));
  1663. void mt_unlock ANSI((int));
  1664. void wrap_it_up ANSI((int));
  1665. void log_entry();
  1666. void log_error();
  1667. X
  1668. int read_data ANSI((void));
  1669. int write_data ANSI((char *));
  1670. void dont_read_data ANSI((int));
  1671. X
  1672. void process_articles ANSI((ART_NUM,ART_NUM));
  1673. X
  1674. int open_server ANSI((void));
  1675. char *file_exp ANSI((char *));
  1676. char *savestr ANSI((char *));
  1677. X
  1678. X#ifndef lint
  1679. char *safemalloc ANSI((MEM_SIZE));
  1680. void free();
  1681. void safefree();
  1682. X#endif
  1683. X
  1684. time_t get_date ANSI((char *,time_t,long));
  1685. X
  1686. X#define Nullart Null(ARTICLE*)
  1687. END_OF_FILE
  1688. if test 1630 -ne `wc -c <'mthreads.h'`; then
  1689.     echo shar: \"'mthreads.h'\" unpacked with wrong size!
  1690. fi
  1691. # end of 'mthreads.h'
  1692. fi
  1693. if test -f 'ng.h' -a "${1}" != "-c" ; then 
  1694.   echo shar: Will not clobber existing file \"'ng.h'\"
  1695. else
  1696. echo shar: Extracting \"'ng.h'\" \(1662 characters\)
  1697. sed "s/^X//" >'ng.h' <<'END_OF_FILE'
  1698. X/* $Id: ng.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1699. X *
  1700. X * $Log: ng.h,v $
  1701. X * Revision 4.4  1991/09/09  20:23:31  sob
  1702. X * release 4.4
  1703. X *
  1704. X *
  1705. X * 
  1706. X */
  1707. X/* This software is Copyright 1991 by Stan Barber. 
  1708. X *
  1709. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1710. X * use this software as long as: there is no monetary profit gained
  1711. X * specifically from the use or reproduction of this software, it is not
  1712. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1713. X * included prominently in any copy made. 
  1714. X *
  1715. X * The author make no claims as to the fitness or correctness of this software
  1716. X * for any use whatsoever, and it is provided as is. Any use of this software
  1717. X * is at the user's own risk. 
  1718. X */
  1719. X
  1720. XEXT ART_NUM art INIT(0);    /* current or prospective article # */
  1721. X
  1722. XEXT int checkcount INIT(0);    /* how many articles have we read */
  1723. X            /*   in the current newsgroup since */
  1724. X            /*   the last checkpoint? */
  1725. XEXT int docheckwhen INIT(20);    /* how often to do checkpoint */
  1726. X
  1727. X#ifdef MAILCALL
  1728. XEXT int mailcount INIT(0);        /* check for mail when 0 mod 10 */
  1729. X#endif
  1730. XEXT char *mailcall INIT(nullstr);
  1731. X#ifdef SERVER
  1732. XEXT bool isfirstart INIT(TRUE);
  1733. X#endif
  1734. XEXT bool forcelast INIT(FALSE);        /* ought we show "End of newsgroup"? */
  1735. XEXT bool forcegrow INIT(FALSE);        /* do we want to recalculate size */
  1736. X                    /* of newsgroup, e.g. after posting? */
  1737. X
  1738. X#define NG_ERROR -1
  1739. X#define NG_NORM 0
  1740. X#define NG_ASK 1
  1741. X#define NG_MINUS 2
  1742. X#define NG_SELPRIOR 3
  1743. X#define NG_SELNEXT 4
  1744. X
  1745. void    ng_init ANSI((void));
  1746. int    do_newsgroup ANSI((char *));
  1747. int    art_switch ANSI((void));
  1748. X#ifdef MAILCALL
  1749. X    void    setmail ANSI((void));
  1750. X#endif
  1751. void    setdfltcmd ANSI((void));
  1752. END_OF_FILE
  1753. if test 1662 -ne `wc -c <'ng.h'`; then
  1754.     echo shar: \"'ng.h'\" unpacked with wrong size!
  1755. fi
  1756. # end of 'ng.h'
  1757. fi
  1758. if test -f 'ngdata.h' -a "${1}" != "-c" ; then 
  1759.   echo shar: Will not clobber existing file \"'ngdata.h'\"
  1760. else
  1761. echo shar: Extracting \"'ngdata.h'\" \(1575 characters\)
  1762. sed "s/^X//" >'ngdata.h' <<'END_OF_FILE'
  1763. X/* $Id: ngdata.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1764. X *
  1765. X * $Log: ngdata.h,v $
  1766. X * Revision 4.4  1991/09/09  20:23:31  sob
  1767. X * release 4.4
  1768. X *
  1769. X *
  1770. X * 
  1771. X */
  1772. X/* This software is Copyright 1991 by Stan Barber. 
  1773. X *
  1774. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1775. X * use this software as long as: there is no monetary profit gained
  1776. X * specifically from the use or reproduction of this software, it is not
  1777. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1778. X * included prominently in any copy made. 
  1779. X *
  1780. X * The author make no claims as to the fitness or correctness of this software
  1781. X * for any use whatsoever, and it is provided as is. Any use of this software
  1782. X * is at the user's own risk. 
  1783. X */
  1784. X
  1785. XEXT FILE *actfp INIT(Nullfp);    /* the active file */
  1786. XEXT bool writesoft INIT(FALSE);    /* rewrite the soft pointer file? */
  1787. XEXT int softtries INIT(0), softmisses INIT(0);
  1788. X
  1789. X#ifdef SERVER
  1790. X    EXT char active_name[MAXFILENAME];
  1791. X#endif
  1792. X
  1793. X#ifdef CACHEFIRST
  1794. X    EXT ART_NUM *abs1st INIT(NULL);    /* 1st real article in newsgroup */
  1795. X#else
  1796. X# ifdef MININACT
  1797. X    EXT ART_NUM abs1st INIT(0);
  1798. X# endif
  1799. X#endif
  1800. X
  1801. XEXT char *moderated;
  1802. X#ifdef USETHREADS
  1803. XEXT char *tmpthread_group INIT(Nullch);
  1804. XEXT int tmpthread_glen INIT(0);
  1805. XEXT char *tmpthread_file INIT(Nullch);
  1806. XEXT bool ThreadedGroup;
  1807. X#endif
  1808. XEXT long activeitems;            /* number of enties in active file */
  1809. void    ngdata_init ANSI((void));
  1810. ART_NUM    getngsize ANSI((NG_NUM));
  1811. ACT_POS findact ANSI((char *,char *,int,long));
  1812. ART_NUM    getabsfirst ANSI((NG_NUM,ART_NUM));
  1813. ART_NUM    getngmin ANSI((char *,ART_NUM));
  1814. END_OF_FILE
  1815. if test 1575 -ne `wc -c <'ngdata.h'`; then
  1816.     echo shar: \"'ngdata.h'\" unpacked with wrong size!
  1817. fi
  1818. # end of 'ngdata.h'
  1819. fi
  1820. if test -f 'ngsrch.h' -a "${1}" != "-c" ; then 
  1821.   echo shar: Will not clobber existing file \"'ngsrch.h'\"
  1822. else
  1823. echo shar: Extracting \"'ngsrch.h'\" \(1145 characters\)
  1824. sed "s/^X//" >'ngsrch.h' <<'END_OF_FILE'
  1825. X/* $Id: ngsrch.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1826. X *
  1827. X * $Log: ngsrch.h,v $
  1828. X * Revision 4.4  1991/09/09  20:23:31  sob
  1829. X * release 4.4
  1830. X *
  1831. X *
  1832. X * 
  1833. X */
  1834. X/* This software is Copyright 1991 by Stan Barber. 
  1835. X *
  1836. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1837. X * use this software as long as: there is no monetary profit gained
  1838. X * specifically from the use or reproduction of this software, it is not
  1839. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1840. X * included prominently in any copy made. 
  1841. X *
  1842. X * The author make no claims as to the fitness or correctness of this software
  1843. X * for any use whatsoever, and it is provided as is. Any use of this software
  1844. X * is at the user's own risk. 
  1845. X */
  1846. X
  1847. X#ifdef NGSEARCH
  1848. X#define NGS_ABORT 0
  1849. X#define NGS_FOUND 1
  1850. X#define NGS_INTR 2
  1851. X#define NGS_NOTFOUND 3
  1852. X#define NGS_ERROR 4
  1853. X
  1854. XEXT bool ng_doread INIT(FALSE);        /* search read newsgroups? */
  1855. X#endif
  1856. X
  1857. void    ngsrch_init ANSI((void));
  1858. X#ifdef NGSEARCH 
  1859. X    int        ng_search ANSI((char *,int));
  1860. X    bool    ng_wanted ANSI((void));
  1861. X#endif
  1862. X#ifdef NGSORONLY
  1863. X    char    *ng_comp ANSI((COMPEX *,char *,bool_int,bool_int));
  1864. X#endif
  1865. END_OF_FILE
  1866. if test 1145 -ne `wc -c <'ngsrch.h'`; then
  1867.     echo shar: \"'ngsrch.h'\" unpacked with wrong size!
  1868. fi
  1869. # end of 'ngsrch.h'
  1870. fi
  1871. if test -f 'ngstuff.h' -a "${1}" != "-c" ; then 
  1872.   echo shar: Will not clobber existing file \"'ngstuff.h'\"
  1873. else
  1874. echo shar: Extracting \"'ngstuff.h'\" \(1091 characters\)
  1875. sed "s/^X//" >'ngstuff.h' <<'END_OF_FILE'
  1876. X/* $Id: ngstuff.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1877. X *
  1878. X * $Log: ngstuff.h,v $
  1879. X * Revision 4.4  1991/09/09  20:23:31  sob
  1880. X * release 4.4
  1881. X *
  1882. X *
  1883. X * 
  1884. X */
  1885. X/* This software is Copyright 1991 by Stan Barber. 
  1886. X *
  1887. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1888. X * use this software as long as: there is no monetary profit gained
  1889. X * specifically from the use or reproduction of this software, it is not
  1890. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  1891. X * included prominently in any copy made. 
  1892. X *
  1893. X * The author make no claims as to the fitness or correctness of this software
  1894. X * for any use whatsoever, and it is provided as is. Any use of this software
  1895. X * is at the user's own risk. 
  1896. X */
  1897. X
  1898. X#define NN_NORM 0
  1899. X#define NN_INP 1
  1900. X#define NN_REREAD 2
  1901. X#define NN_ASK 3
  1902. X
  1903. XEXT bool one_command INIT(FALSE);    /* no ':' processing in perform() */
  1904. X
  1905. void    ngstuff_init ANSI((void));
  1906. int    escapade ANSI((void));
  1907. int    switcheroo ANSI((void));
  1908. int    numnum ANSI((void));
  1909. int    perform ANSI((char *,int));
  1910. X#ifdef USETHREADS
  1911. int    use_selected ANSI((void));
  1912. X#endif
  1913. END_OF_FILE
  1914. if test 1091 -ne `wc -c <'ngstuff.h'`; then
  1915.     echo shar: \"'ngstuff.h'\" unpacked with wrong size!
  1916. fi
  1917. # end of 'ngstuff.h'
  1918. fi
  1919. if test ! -d 'nntp' ; then
  1920.     echo shar: Creating directory \"'nntp'\"
  1921.     mkdir 'nntp'
  1922. fi
  1923. if test -f 'nntp/support.patch' -a "${1}" != "-c" ; then 
  1924.   echo shar: Will not clobber existing file \"'nntp/support.patch'\"
  1925. else
  1926. echo shar: Extracting \"'nntp/support.patch'\" \(651 characters\)
  1927. sed "s/^X//" >'nntp/support.patch' <<'END_OF_FILE'
  1928. Index: Makefile
  1929. X@@ -3,7 +3,7 @@
  1930. X #
  1931. X-OBJS    =    mkgrdates.o
  1932. X+OBJS    =    acttimes.o
  1933. X-SRCS    =    mkgrdates.c
  1934. X+SRCS    =    acttimes.c
  1935. X HFILES    =    ../common/conf.h
  1936. X@@ -15,18 +15,18 @@
  1937. X DESTDIR    = /usr/lib/news
  1938. X-all: mkgrdates
  1939. X+all: acttimes
  1940. X-mkgrdates: mkgrdates.o
  1941. X-    $(CC) ${CFLAGS} -o mkgrdates mkgrdates.o
  1942. X+acttimes: acttimes.o
  1943. X+    $(CC) ${CFLAGS} -o acttimes acttimes.o
  1944. X-install: mkgrdates
  1945. X-    cp mkgrdates ${DESTDIR}/mkgrdates
  1946. X-    chmod 755 ${DESTDIR}/mkgrdates
  1947. X+install: acttimes
  1948. X+    cp acttimes ${DESTDIR}/acttimes
  1949. X+    chmod 755 ${DESTDIR}/acttimes
  1950. X lint:
  1951. X-    lint mkgrdates.c
  1952. X+    lint acttimes.c
  1953. X clean:
  1954. X-    -rm -f *.o mkgrdates
  1955. X+    -rm -f *.o acttimes
  1956. X distrib: clean
  1957. END_OF_FILE
  1958. if test 651 -ne `wc -c <'nntp/support.patch'`; then
  1959.     echo shar: \"'nntp/support.patch'\" unpacked with wrong size!
  1960. fi
  1961. # end of 'nntp/support.patch'
  1962. fi
  1963. if test -f 'norm.saver.SH' -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not clobber existing file \"'norm.saver.SH'\"
  1965. else
  1966. echo shar: Extracting \"'norm.saver.SH'\" \(1383 characters\)
  1967. sed "s/^X//" >'norm.saver.SH' <<'END_OF_FILE'
  1968. case $CONFIG in
  1969. X    '') . ./config.sh ;;
  1970. esac
  1971. echo "Extracting norm.saver (with variable substitutions)"
  1972. X$spitshell >norm.saver <<!GROK!THIS!
  1973. X$startsh
  1974. X# $Id: norm.saver.SH,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1975. X# 
  1976. X# $Log: norm.saver.SH,v $
  1977. X# Revision 4.4  1991/09/09  20:23:31  sob
  1978. X# release 4.4
  1979. X#
  1980. X# 
  1981. X# This software is Copyright 1991 by Stan Barber. 
  1982. X#
  1983. X# Permission is hereby granted to copy, reproduce, redistribute or otherwise
  1984. X# use this software as long as: there is no monetary profit gained
  1985. X# specifically from the use or reproduction of this software, it is not
  1986. X# sold, rented, traded or otherwise marketed, and this copyright notice is
  1987. X# included prominently in any copy made. 
  1988. X#
  1989. X# The author make no claims as to the fitness or correctness of this software
  1990. X# for any use whatsoever, and it is provided as is. Any use of this software
  1991. X# is at the user's own risk. 
  1992. X# 
  1993. X#    Arguments:
  1994. X#    1 Full name of article (%A)
  1995. X#    2 Public news spool directory (%P)
  1996. X#    3 Directory of current newsgroup (%c)
  1997. X#    4 Article number (%a)
  1998. X#    5 Where in article to start (%B)
  1999. X#    6 Newsgroup name (%C)
  2000. X#    7 Save destination (%b)
  2001. X#
  2002. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  2003. X
  2004. X( case "\$5" in
  2005. X  0) $echo "Article \$4 of \$6:" ;;
  2006. X  esac
  2007. X  $tail +\$5c \$1
  2008. X  $echo ""
  2009. X  $echo "" ) >> \$7
  2010. X!GROK!THIS!
  2011. X$eunicefix norm.saver
  2012. chmod 755 norm.saver
  2013. END_OF_FILE
  2014. if test 1383 -ne `wc -c <'norm.saver.SH'`; then
  2015.     echo shar: \"'norm.saver.SH'\" unpacked with wrong size!
  2016. fi
  2017. # end of 'norm.saver.SH'
  2018. fi
  2019. if test -f 'only.h' -a "${1}" != "-c" ; then 
  2020.   echo shar: Will not clobber existing file \"'only.h'\"
  2021. else
  2022. echo shar: Extracting \"'only.h'\" \(1282 characters\)
  2023. sed "s/^X//" >'only.h' <<'END_OF_FILE'
  2024. X/* $Id: only.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  2025. X *
  2026. X * $Log: only.h,v $
  2027. X * Revision 4.4  1991/09/09  20:23:31  sob
  2028. X * release 4.4
  2029. X *
  2030. X *
  2031. X * 
  2032. X */
  2033. X/* This software is Copyright 1991 by Stan Barber. 
  2034. X *
  2035. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2036. X * use this software as long as: there is no monetary profit gained
  2037. X * specifically from the use or reproduction of this software, it is not
  2038. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2039. X * included prominently in any copy made. 
  2040. X *
  2041. X * The author make no claims as to the fitness or correctness of this software
  2042. X * for any use whatsoever, and it is provided as is. Any use of this software
  2043. X * is at the user's own risk. 
  2044. X */
  2045. X
  2046. X#ifndef NBRA
  2047. X#include "search.h"
  2048. X#endif
  2049. X
  2050. X#ifdef ONLY
  2051. X    EXT char *ngtodo[NGMAX];        /* restrictions in effect */
  2052. X#   ifdef SPEEDOVERMEM
  2053. X    EXT COMPEX *compextodo[NGMAX];    /* restrictions in compiled form */
  2054. X#   endif
  2055. X#endif
  2056. X
  2057. XEXT int maxngtodo INIT(0);            /*  0 => no restrictions */
  2058. X                    /* >0 => # of entries in ngtodo */
  2059. X
  2060. void    only_init ANSI((void));
  2061. bool    inlist ANSI((char *));    /* return TRUE if ngname is in command line list */
  2062. X            /* or if there was no list */
  2063. void    setngtodo ANSI((char *));
  2064. X#ifdef ONLY
  2065. X    void    end_only ANSI((void));
  2066. X#endif
  2067. END_OF_FILE
  2068. if test 1282 -ne `wc -c <'only.h'`; then
  2069.     echo shar: \"'only.h'\" unpacked with wrong size!
  2070. fi
  2071. # end of 'only.h'
  2072. fi
  2073. if test -f 'patchlevel' -a "${1}" != "-c" ; then 
  2074.   echo shar: Will not clobber existing file \"'patchlevel'\"
  2075. else
  2076. echo shar: Extracting \"'patchlevel'\" \(9 characters\)
  2077. sed "s/^X//" >'patchlevel' <<'END_OF_FILE'
  2078. trn v2.1
  2079. END_OF_FILE
  2080. if test 9 -ne `wc -c <'patchlevel'`; then
  2081.     echo shar: \"'patchlevel'\" unpacked with wrong size!
  2082. fi
  2083. # end of 'patchlevel'
  2084. fi
  2085. if test -f 'rcln.h' -a "${1}" != "-c" ; then 
  2086.   echo shar: Will not clobber existing file \"'rcln.h'\"
  2087. else
  2088. echo shar: Extracting \"'rcln.h'\" \(1132 characters\)
  2089. sed "s/^X//" >'rcln.h' <<'END_OF_FILE'
  2090. X/* $Id: rcln.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
  2091. X *
  2092. X * $Log: rcln.h,v $
  2093. X * Revision 4.4  1991/09/09  20:27:37  sob
  2094. X * release 4.4
  2095. X *
  2096. X *
  2097. X * 
  2098. X */
  2099. X/* This software is Copyright 1991 by Stan Barber. 
  2100. X *
  2101. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2102. X * use this software as long as: there is no monetary profit gained
  2103. X * specifically from the use or reproduction of this software, it is not
  2104. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2105. X * included prominently in any copy made. 
  2106. X *
  2107. X * The author make no claims as to the fitness or correctness of this software
  2108. X * for any use whatsoever, and it is provided as is. Any use of this software
  2109. X * is at the user's own risk. 
  2110. X */
  2111. X
  2112. X#if defined(DEBUGGING) || defined(USETHREADS)
  2113. XEXT ART_NUM *ngmax INIT(NULL);
  2114. X#endif
  2115. X
  2116. void    rcln_init ANSI((void));
  2117. X#ifdef CATCHUP
  2118. X    void    catch_up ANSI((NG_NUM));
  2119. X#endif
  2120. int    addartnum ANSI((ART_NUM,char *));
  2121. X#ifdef MCHASE
  2122. X    void    subartnum ANSI((ART_NUM,char *));
  2123. X#endif
  2124. void    prange ANSI((char *,ART_NUM,ART_NUM));
  2125. void    set_toread ANSI((NG_NUM));
  2126. void    checkexpired ANSI((NG_NUM,ART_NUM));
  2127. END_OF_FILE
  2128. if test 1132 -ne `wc -c <'rcln.h'`; then
  2129.     echo shar: \"'rcln.h'\" unpacked with wrong size!
  2130. fi
  2131. # end of 'rcln.h'
  2132. fi
  2133. if test -f 'respond.h' -a "${1}" != "-c" ; then 
  2134.   echo shar: Will not clobber existing file \"'respond.h'\"
  2135. else
  2136. echo shar: Extracting \"'respond.h'\" \(1328 characters\)
  2137. sed "s/^X//" >'respond.h' <<'END_OF_FILE'
  2138. X/* $Id: respond.h,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  2139. X *
  2140. X * $Log: respond.h,v $
  2141. X * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  2142. X * Patchlevel 2 changes
  2143. X *
  2144. X * Revision 4.4  1991/09/09  20:27:37  sob
  2145. X * release 4.4
  2146. X *
  2147. X * 
  2148. X */
  2149. X/* This software is Copyright 1991 by Stan Barber. 
  2150. X *
  2151. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2152. X * use this software as long as: there is no monetary profit gained
  2153. X * specifically from the use or reproduction of this software, it is not
  2154. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2155. X * included prominently in any copy made. 
  2156. X *
  2157. X * The author make no claims as to the fitness or correctness of this software
  2158. X * for any use whatsoever, and it is provided as is. Any use of this software
  2159. X * is at the user's own risk. 
  2160. X */
  2161. X
  2162. XEXT char *savedest INIT(Nullch);    /* value of %b */
  2163. XEXT char *extractdest INIT(Nullch);    /* value of %E */
  2164. XEXT char *extractprog INIT(Nullch);    /* value of %e */
  2165. XEXT ART_POS savefrom INIT(0);        /* value of %B */
  2166. XEXT char *headname INIT(Nullch);
  2167. X
  2168. X#define SAVE_ABORT 0
  2169. X#define SAVE_DONE 1
  2170. X
  2171. void    respond_init ANSI((void));
  2172. int    save_article ANSI((void));
  2173. int    cancel_article ANSI((void));
  2174. int    supersede_article ANSI((void));
  2175. void    reply ANSI((void));
  2176. void    followup ANSI((void));
  2177. void    invoke ANSI((char *,char *));
  2178. END_OF_FILE
  2179. if test 1328 -ne `wc -c <'respond.h'`; then
  2180.     echo shar: \"'respond.h'\" unpacked with wrong size!
  2181. fi
  2182. # end of 'respond.h'
  2183. fi
  2184. if test -f 'rn.h' -a "${1}" != "-c" ; then 
  2185.   echo shar: Will not clobber existing file \"'rn.h'\"
  2186. else
  2187. echo shar: Extracting \"'rn.h'\" \(1597 characters\)
  2188. sed "s/^X//" >'rn.h' <<'END_OF_FILE'
  2189. X/* $Id: rn.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
  2190. X *
  2191. X * $Log: rn.h,v $
  2192. X * Revision 4.4  1991/09/09  20:27:37  sob
  2193. X * release 4.4
  2194. X *
  2195. X *
  2196. X * 
  2197. X */
  2198. X/* This software is Copyright 1991 by Stan Barber. 
  2199. X *
  2200. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2201. X * use this software as long as: there is no monetary profit gained
  2202. X * specifically from the use or reproduction of this software, it is not
  2203. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2204. X * included prominently in any copy made. 
  2205. X *
  2206. X * The author make no claims as to the fitness or correctness of this software
  2207. X * for any use whatsoever, and it is provided as is. Any use of this software
  2208. X * is at the user's own risk. 
  2209. X */
  2210. X
  2211. XEXT char *ngname INIT(Nullch);        /* name of current newsgroup */
  2212. XEXT int ngnlen INIT(0);            /* current malloced size of ngname */
  2213. XEXT char *ngdir INIT(Nullch);        /* same thing in directory name form */
  2214. XEXT int ngdlen INIT(0);            /* current malloced size of ngdir */
  2215. X
  2216. XEXT NG_NUM ng INIT(0);        /* current newsgroup index into rcline and toread */
  2217. XEXT NG_NUM current_ng INIT(0);    /* stable current newsgroup so we can ditz with ng */
  2218. XEXT NG_NUM starthere INIT(0);   /* set to the first newsgroup with unread news on startup */
  2219. XEXT char *spool INIT(Nullch);        /* public news spool directory */
  2220. X#ifdef USETHREADS
  2221. XEXT char *threaddir INIT(Nullch);    /* directory for thread data */
  2222. XEXT char *mtlib INIT(Nullch);        /* directory for mthreads files */
  2223. X#endif
  2224. X
  2225. void    rn_init ANSI((void));
  2226. void    main ANSI((int,char **));
  2227. void    set_ngname ANSI((char *));
  2228. char    *getngdir ANSI((char *));
  2229. END_OF_FILE
  2230. if test 1597 -ne `wc -c <'rn.h'`; then
  2231.     echo shar: \"'rn.h'\" unpacked with wrong size!
  2232. fi
  2233. # end of 'rn.h'
  2234. fi
  2235. if test -f 'rthreads.h' -a "${1}" != "-c" ; then 
  2236.   echo shar: Will not clobber existing file \"'rthreads.h'\"
  2237. else
  2238. echo shar: Extracting \"'rthreads.h'\" \(1591 characters\)
  2239. sed "s/^X//" >'rthreads.h' <<'END_OF_FILE'
  2240. X/* $Id: rthreads.h,v 4.4.3.1 1991/11/22 04:12:18 davison Trn $
  2241. X**
  2242. X** $Log: rthreads.h,v $
  2243. X** Revision 4.4.3.1  1991/11/22  04:12:18  davison
  2244. X** Trn Release 2.0
  2245. X** 
  2246. X*/
  2247. X
  2248. XEXT TOTAL total;
  2249. X
  2250. XEXT PACKED_ROOT *p_roots INIT(0);
  2251. XEXT WORD *root_subjects INIT(0);
  2252. XEXT WORD *author_cnts INIT(0);
  2253. XEXT WORD *subject_cnts INIT(0);
  2254. XEXT char **author_ptrs INIT(0);
  2255. XEXT char **subject_ptrs INIT(0);
  2256. XEXT PACKED_ARTICLE *p_articles INIT(0);
  2257. XEXT WORD *root_article_cnts INIT(0);
  2258. XEXT char *selected_roots INIT(0);
  2259. XEXT ART_NUM *saved_selections INIT(0);
  2260. XEXT bool unread_selector INIT(0);
  2261. X
  2262. XEXT PACKED_ARTICLE *p_art INIT(0);
  2263. XEXT PACKED_ARTICLE *curr_p_art INIT(0);
  2264. XEXT PACKED_ARTICLE *recent_p_art INIT(0);
  2265. X
  2266. XEXT int selected_root_cnt INIT(0);
  2267. XEXT ART_NUM selected_count INIT(0);
  2268. XEXT int unthreaded INIT(0);
  2269. XEXT int select_page;
  2270. XEXT bool scan_all_roots;
  2271. XEXT bool output_chase_phrase;
  2272. X
  2273. X#ifndef USETMPTHREAD
  2274. XEXT int tobethreaded INIT(0);
  2275. X#endif
  2276. X
  2277. void thread_init ANSI((void));
  2278. char *safemalloc ANSI((MEM_SIZE));
  2279. int use_data ANSI((bool_int));
  2280. void unuse_data ANSI((bool_int));
  2281. void find_article ANSI((ART_NUM));
  2282. void init_tree ANSI((void));
  2283. void entire_tree ANSI((void));
  2284. int tree_puts ANSI((char *,ART_LINE,int));
  2285. int finish_tree ANSI((ART_LINE));
  2286. void first_art ANSI((void));
  2287. void follow_thread ANSI((char_int));
  2288. void backtrack_thread ANSI((char_int));
  2289. void next_root ANSI((void));
  2290. void prev_root ANSI((void));
  2291. char select_thread ANSI((char_int));
  2292. int count_roots ANSI((bool_int));
  2293. int count_one_root ANSI((int));
  2294. PACKED_ARTICLE *upper_limit ANSI((PACKED_ARTICLE *,bool_int));
  2295. X
  2296. X#define Nullart Null(PACKED_ARTICLE*)
  2297. END_OF_FILE
  2298. if test 1591 -ne `wc -c <'rthreads.h'`; then
  2299.     echo shar: \"'rthreads.h'\" unpacked with wrong size!
  2300. fi
  2301. # end of 'rthreads.h'
  2302. fi
  2303. if test -f 'search.h' -a "${1}" != "-c" ; then 
  2304.   echo shar: Will not clobber existing file \"'search.h'\"
  2305. else
  2306. echo shar: Extracting \"'search.h'\" \(1835 characters\)
  2307. sed "s/^X//" >'search.h' <<'END_OF_FILE'
  2308. X/* $Id: search.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
  2309. X *
  2310. X * $Log: search.h,v $
  2311. X * Revision 4.4  1991/09/09  20:27:37  sob
  2312. X * release 4.4
  2313. X *
  2314. X *
  2315. X *
  2316. X */
  2317. X/* This software is Copyright 1991 by Stan Barber. 
  2318. X *
  2319. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2320. X * use this software as long as: there is no monetary profit gained
  2321. X * specifically from the use or reproduction of this software, it is not
  2322. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2323. X * included prominently in any copy made. 
  2324. X *
  2325. X * The author make no claims as to the fitness or correctness of this software
  2326. X * for any use whatsoever, and it is provided as is. Any use of this software
  2327. X * is at the user's own risk. 
  2328. X */
  2329. X
  2330. X#ifndef NBRA
  2331. X#define    NBRA    10        /* the maximum number of meta-brackets in an
  2332. X                   RE -- \( \) */
  2333. X#define NALTS    10        /* the maximum number of \|'s */
  2334. typedef struct {    
  2335. X    char *expbuf;        /* The compiled search string */
  2336. X    int eblen;            /* Length of above buffer */
  2337. X    char *alternatives[NALTS];    /* The list of \| seperated alternatives */
  2338. X    char *braslist[NBRA];    /* RE meta-bracket start list */
  2339. X    char *braelist[NBRA];    /* RE meta-bracket end list */
  2340. X    char *brastr;        /* saved match string after execute() */
  2341. X    char nbra;            /* The number of meta-brackets int the most
  2342. X                   recenlty compiled RE */
  2343. X    bool do_folding;        /* fold upper and lower case? */
  2344. X} COMPEX;
  2345. X
  2346. void    search_init ANSI((void));
  2347. void    init_compex ANSI((COMPEX *));
  2348. void    free_compex ANSI((COMPEX *));
  2349. char    *getbracket ANSI((COMPEX *,int));
  2350. void    case_fold ANSI((int));
  2351. char    *compile ANSI((COMPEX *,char *,int,int)); 
  2352. void    grow_eb ANSI((COMPEX *));
  2353. char    *execute ANSI((COMPEX *,char *)); 
  2354. bool    advance ANSI((COMPEX *,char *,char *));
  2355. bool    backref ANSI((COMPEX *,int,char *)); 
  2356. bool    cclass ANSI((char *,int,int));
  2357. X#endif
  2358. END_OF_FILE
  2359. if test 1835 -ne `wc -c <'search.h'`; then
  2360.     echo shar: \"'search.h'\" unpacked with wrong size!
  2361. fi
  2362. # end of 'search.h'
  2363. fi
  2364. if test -f 'server.c' -a "${1}" != "-c" ; then 
  2365.   echo shar: Will not clobber existing file \"'server.c'\"
  2366. else
  2367. echo shar: Extracting \"'server.c'\" \(765 characters\)
  2368. sed "s/^X//" >'server.c' <<'END_OF_FILE'
  2369. X/* $Id: server.c,v 4.4.3.1 1991/11/22 04:12:21 davison Trn $
  2370. X**
  2371. X** $Log:    server.c,v $
  2372. X** Revision 4.4.3.1  1991/11/22  04:12:21  davison
  2373. X** Trn Release 2.0
  2374. X** 
  2375. X*/
  2376. X
  2377. X#include "EXTERN.h"
  2378. X#include "common.h"
  2379. X#include "threads.h"
  2380. X
  2381. X#ifdef SERVER
  2382. X
  2383. X#include "server.h"
  2384. X
  2385. char *
  2386. get_server_name(errflag)
  2387. int errflag;
  2388. X{
  2389. X    char *name;
  2390. X    extern char *getenv();
  2391. X
  2392. X    if (SERVER_FILE[0] == '/') {
  2393. X    name = getserverbyfile(SERVER_FILE);
  2394. X    } else {
  2395. X    if ((name = getenv("NNTPSERVER")) == NULL)
  2396. X        name = SERVER_FILE;
  2397. X    }
  2398. X    if (name == NULL && errflag) {
  2399. X    fprintf(stderr, "Couldn't get name of news server from %s\n",
  2400. X        SERVER_FILE);
  2401. X    fprintf(stderr,
  2402. X        "Either fix this file, or put NNTPSERVER in your environment.\n");
  2403. X    }
  2404. X    return name;
  2405. X}
  2406. X
  2407. X#endif /* SERVER */
  2408. X
  2409. END_OF_FILE
  2410. if test 765 -ne `wc -c <'server.c'`; then
  2411.     echo shar: \"'server.c'\" unpacked with wrong size!
  2412. fi
  2413. # end of 'server.c'
  2414. fi
  2415. if test -f 'server.h.SH' -a "${1}" != "-c" ; then 
  2416.   echo shar: Will not clobber existing file \"'server.h.SH'\"
  2417. else
  2418. echo shar: Extracting \"'server.h.SH'\" \(1395 characters\)
  2419. sed "s/^X//" >'server.h.SH' <<'END_OF_FILE'
  2420. X: create server.h file
  2421. case $CONFIG in
  2422. X    '') . ./config.sh ;;
  2423. esac
  2424. if $test $isrrn = define 
  2425. then
  2426. X$echo "Extracting server.h (with variable substitutions)"
  2427. X$cat >server.h <<!GROK!THIS!
  2428. X/*
  2429. X * $Id$
  2430. X * 
  2431. X * $Log$
  2432. X * 
  2433. X * 
  2434. X * This software is Copyright 1991 by Stan Barber. 
  2435. X * 
  2436. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2437. X * use this software as long as: there is no monetary profit gained
  2438. X * specifically from the use or reproduction of this software, it is not
  2439. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2440. X * included prominently in any copy made. 
  2441. X *
  2442. X * The author make no claims as to the fitness or correctness of this software
  2443. X * for any use whatsoever, and it is provided as is. Any use of this software
  2444. X *is at the user's own risk. 
  2445. X */
  2446. X#ifdef SERVER
  2447. X
  2448. extern    char    *get_server_name ANSI((int));
  2449. extern    char    *getserverbyfile ANSI((char *));
  2450. extern    int    server_init ANSI((char *));
  2451. extern    void    put_server ANSI((char *));
  2452. extern    int    get_server ANSI((char *,int));
  2453. extern    long    rawcheck_server ANSI((char *,int));
  2454. extern    long    rawget_server ANSI((char *,long));
  2455. extern    void    close_server ANSI((void));
  2456. X
  2457. X#include "$NNTPSRC/common/nntp.h"
  2458. XEXT     char ser_line[NNTP_STRLEN];
  2459. X
  2460. X# if defined(XTHREAD) && !defined(OK_BIN)
  2461. X     ??????  /* This version of NNTP doesn't have XTHREAD support */
  2462. X# endif
  2463. X
  2464. X#endif
  2465. X!GROK!THIS!
  2466. else
  2467. X    rm -f server.h
  2468. fi
  2469. END_OF_FILE
  2470. if test 1395 -ne `wc -c <'server.h.SH'`; then
  2471.     echo shar: \"'server.h.SH'\" unpacked with wrong size!
  2472. fi
  2473. # end of 'server.h.SH'
  2474. fi
  2475. if test -f 'sw.h' -a "${1}" != "-c" ; then 
  2476.   echo shar: Will not clobber existing file \"'sw.h'\"
  2477. else
  2478. echo shar: Extracting \"'sw.h'\" \(999 characters\)
  2479. sed "s/^X//" >'sw.h' <<'END_OF_FILE'
  2480. X/* $Id: sw.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
  2481. X *
  2482. X * $Log: sw.h,v $
  2483. X * Revision 4.4  1991/09/09  20:27:37  sob
  2484. X * release 4.4
  2485. X *
  2486. X *
  2487. X * 
  2488. X */
  2489. X/* This software is Copyright 1991 by Stan Barber. 
  2490. X *
  2491. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2492. X * use this software as long as: there is no monetary profit gained
  2493. X * specifically from the use or reproduction of this software, it is not
  2494. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2495. X * included prominently in any copy made. 
  2496. X *
  2497. X * The author make no claims as to the fitness or correctness of this software
  2498. X * for any use whatsoever, and it is provided as is. Any use of this software
  2499. X * is at the user's own risk. 
  2500. X */
  2501. X
  2502. X#ifdef INNERSEARCH
  2503. XEXT int gline INIT(0);
  2504. X#endif
  2505. X
  2506. void    sw_init ANSI((int,char **,char **));
  2507. void    sw_file ANSI((char **,bool_int));
  2508. void    sw_list ANSI((char *));
  2509. void    decode_switch ANSI((char *));
  2510. void    pr_switches ANSI((void));
  2511. void    cwd_check ANSI((void));
  2512. END_OF_FILE
  2513. if test 999 -ne `wc -c <'sw.h'`; then
  2514.     echo shar: \"'sw.h'\" unpacked with wrong size!
  2515. fi
  2516. # end of 'sw.h'
  2517. fi
  2518. if test -f 'threads.h' -a "${1}" != "-c" ; then 
  2519.   echo shar: Will not clobber existing file \"'threads.h'\"
  2520. else
  2521. echo shar: Extracting \"'threads.h'\" \(2075 characters\)
  2522. sed "s/^X//" >'threads.h' <<'END_OF_FILE'
  2523. X/* $Id: threads.h,v 4.4.3.1 1991/11/22 04:12:21 davison Trn $
  2524. X**
  2525. X** $Log:    threads.h,v $
  2526. X** Revision 4.4.3.1  1991/11/22  04:12:21  davison
  2527. X** Trn Release 2.0
  2528. X** 
  2529. X*/
  2530. X
  2531. X#define DB_VERSION    2
  2532. X
  2533. typedef char        BYTE;
  2534. typedef short        WORD;
  2535. typedef long        LONG;
  2536. X
  2537. X#define ROOT_ARTICLE    0x0001        /* article flag definitions */
  2538. X#define HAS_XREFS    0x0004        /* article has an xref line */
  2539. X
  2540. typedef struct Article {
  2541. X    ART_NUM num;
  2542. X    char *id;
  2543. X    struct Domain *domain;
  2544. X    struct Subject *subject;
  2545. X    struct Author *author;
  2546. X    struct Article *parent, *children, *siblings;
  2547. X    struct Root *root;
  2548. X    struct Article *id_link;
  2549. X    time_t date;
  2550. X    WORD child_cnt;
  2551. X    WORD flags;
  2552. X    WORD seq;
  2553. X} ARTICLE;
  2554. X
  2555. typedef struct Domain {
  2556. X    char *name;
  2557. X    ARTICLE *ids;
  2558. X    struct Domain *link;
  2559. X} DOMAIN;
  2560. X
  2561. typedef struct Author {
  2562. X    struct Author *link;        /* this link MUST be first */
  2563. X    char *name;
  2564. X    WORD seq;
  2565. X    WORD count;
  2566. X} AUTHOR;
  2567. X
  2568. typedef struct Subject {
  2569. X    struct Subject *link;        /* this link MUST be first */
  2570. X    char *str;
  2571. X    WORD seq;
  2572. X    WORD count;
  2573. X} SUBJECT;
  2574. X
  2575. typedef struct Root {
  2576. X    struct Root *link;            /* this link MUST be first */
  2577. X    ARTICLE *articles;
  2578. X    SUBJECT *subjects;
  2579. X    ART_NUM root_num;
  2580. X    WORD thread_cnt;
  2581. X    WORD subject_cnt;
  2582. X    WORD seq;
  2583. X} ROOT;
  2584. X
  2585. typedef struct {
  2586. X    LONG root_num;
  2587. X    WORD articles;
  2588. X    WORD thread_cnt;
  2589. X    WORD subject_cnt;
  2590. X    WORD pad_hack;
  2591. X} PACKED_ROOT;
  2592. X
  2593. typedef struct {
  2594. X    LONG num;
  2595. X    LONG date;
  2596. X    WORD subject, author;
  2597. X    WORD flags;
  2598. X    WORD child_cnt;
  2599. X    WORD parent;
  2600. X    WORD padding;
  2601. X    WORD siblings;
  2602. X    WORD root;
  2603. X} PACKED_ARTICLE;
  2604. X
  2605. typedef struct Total {
  2606. X    LONG first, last;
  2607. X    LONG string1;
  2608. X    LONG string2;
  2609. X    WORD root;
  2610. X    WORD article;
  2611. X    WORD subject;
  2612. X    WORD author;
  2613. X    WORD domain;
  2614. X    WORD pad_hack;
  2615. X} TOTAL;
  2616. X
  2617. typedef struct {
  2618. X    BYTE l[sizeof (LONG)];
  2619. X    BYTE w[sizeof (WORD)];
  2620. X    BYTE version;
  2621. X    BYTE pad_hack;
  2622. X} BMAP;
  2623. X
  2624. XEXT bool word_same, long_same;
  2625. XEXT BMAP my_bmap, mt_bmap;
  2626. X
  2627. char *thread_name ANSI((char *));
  2628. void mybytemap ANSI((BMAP *));
  2629. void wp_bmap(), lp_bmap(), swap_bmaps();
  2630. END_OF_FILE
  2631. if test 2075 -ne `wc -c <'threads.h'`; then
  2632.     echo shar: \"'threads.h'\" unpacked with wrong size!
  2633. fi
  2634. # end of 'threads.h'
  2635. fi
  2636. if test -f 'tm-process.c' -a "${1}" != "-c" ; then 
  2637.   echo shar: Will not clobber existing file \"'tm-process.c'\"
  2638. else
  2639. echo shar: Extracting \"'tm-process.c'\" \(214 characters\)
  2640. sed "s/^X//" >'tm-process.c' <<'END_OF_FILE'
  2641. X/* $Id: tm-process.c,v 4.4.3.1 1991/11/22 04:12:21 davison Trn $
  2642. X**
  2643. X** $Log: tm-process.c,v $
  2644. X** Revision 4.4.3.1  1991/11/22  04:12:21  davison
  2645. X** Trn Release 2.0
  2646. X** 
  2647. X*/
  2648. X
  2649. X#define TMPTHREAD
  2650. X#include "mt-process.c"
  2651. END_OF_FILE
  2652. if test 214 -ne `wc -c <'tm-process.c'`; then
  2653.     echo shar: \"'tm-process.c'\" unpacked with wrong size!
  2654. fi
  2655. # end of 'tm-process.c'
  2656. fi
  2657. if test -f 'tm-read.c' -a "${1}" != "-c" ; then 
  2658.   echo shar: Will not clobber existing file \"'tm-read.c'\"
  2659. else
  2660. echo shar: Extracting \"'tm-read.c'\" \(205 characters\)
  2661. sed "s/^X//" >'tm-read.c' <<'END_OF_FILE'
  2662. X/* $Id: tm-read.c,v 4.4.3.1 1991/11/22 04:12:21 davison Trn $
  2663. X**
  2664. X** $Log: tm-read.c,v $
  2665. X** Revision 4.4.3.1  1991/11/22  04:12:21  davison
  2666. X** Trn Release 2.0
  2667. X** 
  2668. X*/
  2669. X
  2670. X#define TMPTHREAD
  2671. X#include "mt-read.c"
  2672. END_OF_FILE
  2673. if test 205 -ne `wc -c <'tm-read.c'`; then
  2674.     echo shar: \"'tm-read.c'\" unpacked with wrong size!
  2675. fi
  2676. # end of 'tm-read.c'
  2677. fi
  2678. if test -f 'tm-write.c' -a "${1}" != "-c" ; then 
  2679.   echo shar: Will not clobber existing file \"'tm-write.c'\"
  2680. else
  2681. echo shar: Extracting \"'tm-write.c'\" \(209 characters\)
  2682. sed "s/^X//" >'tm-write.c' <<'END_OF_FILE'
  2683. X/* $Id: tm-write.c,v 4.4.3.1 1991/11/22 04:12:21 davison Trn $
  2684. X**
  2685. X** $Log: tm-write.c,v $
  2686. X** Revision 4.4.3.1  1991/11/22  04:12:21  davison
  2687. X** Trn Release 2.0
  2688. X** 
  2689. X*/
  2690. X
  2691. X#define TMPTHWRITE
  2692. X#include "mt-write.c"
  2693. END_OF_FILE
  2694. if test 209 -ne `wc -c <'tm-write.c'`; then
  2695.     echo shar: \"'tm-write.c'\" unpacked with wrong size!
  2696. fi
  2697. # end of 'tm-write.c'
  2698. fi
  2699. if test -f 'unipatch.c' -a "${1}" != "-c" ; then 
  2700.   echo shar: Will not clobber existing file \"'unipatch.c'\"
  2701. else
  2702. echo shar: Extracting \"'unipatch.c'\" \(1507 characters\)
  2703. sed "s/^X//" >'unipatch.c' <<'END_OF_FILE'
  2704. X/*
  2705. A filter to turn a unified diff into a degenerate context diff (no '!'s)
  2706. for patch. Version 1.1. Author: davison@borland.com
  2707. X*/
  2708. X#include <stdio.h>
  2709. X#define ERR(a) {fputs(a,stderr);exit(1);}
  2710. X#define NUM(x) {for(x=0;*cp<='9'&&*cp>='0';)x=x*10+*cp++-'0';ch= *cp++;}
  2711. struct Ln {struct Ln *lk; char t; char s[1];} r,*h,*ln;
  2712. char bf[2048],*cp,ch,*malloc();
  2713. long os,ol,ns,nl,ne,lncnt;
  2714. main()
  2715. X{
  2716. X for(;;){
  2717. X  for(;;){
  2718. X   if(!fgets(bf,sizeof bf,stdin)) exit(0);
  2719. X   lncnt++;
  2720. X   if(!strncmp(bf,"@@ -",4)) break;
  2721. X   fputs(bf,stdout);
  2722. X  }
  2723. X  ol=nl=1, cp=bf+4;
  2724. X  NUM(os)
  2725. X  if(ch==',') NUM(ol)
  2726. X  if(*cp++!='+') goto bad;
  2727. X  NUM(ns)
  2728. X  if(ch==',') NUM(nl)
  2729. X  if(*cp!='@') goto bad;
  2730. X  r.lk=0, h= &r, ne=ns+nl-1;
  2731. X  printf("***************\n*** %ld,%ld ****\n",os,os+ol-(os>0));
  2732. X  while(ol||nl){
  2733. X   if(!fgets(bf,sizeof bf,stdin)){
  2734. X    if(nl>2) ERR("Unexpected end of file.\n")
  2735. X    strcpy(bf," \n");
  2736. X   }
  2737. X   lncnt++;
  2738. X   if(*bf=='\t'||*bf=='\n') ch=' ', cp=bf;
  2739. X   else ch= *bf, cp=bf+1;
  2740. X   switch(ch){
  2741. X   case'-':if(!ol--) goto bad;
  2742. X    printf("- %s",cp);
  2743. X    break;
  2744. X   case'=':ch=' ';
  2745. X   case' ':if(!ol--) goto bad;
  2746. X    printf("  %s",cp);
  2747. X   case'+':if(!nl--) goto bad;
  2748. X    ln = (struct Ln*)malloc(sizeof(*ln)+strlen(cp));
  2749. X    if(!ln) ERR("Out of memory!\n")
  2750. X    ln->lk=0, ln->t=ch, strcpy(ln->s,cp);
  2751. X    h->lk=ln, h=ln;
  2752. X    break;
  2753. X   default:
  2754. bad:    fprintf(stderr,"Malformed unified diff at line %ld: ",lncnt);
  2755. X    ERR(bf)
  2756. X   }
  2757. X  }
  2758. X  printf("--- %ld,%ld ----\n",ns,ne);
  2759. X  for(ln=r.lk;ln;ln=h){
  2760. X   printf("%c %s",ln->t,ln->s);
  2761. X   h=ln->lk; free(ln);
  2762. X  }
  2763. X }
  2764. X}
  2765. END_OF_FILE
  2766. if test 1507 -ne `wc -c <'unipatch.c'`; then
  2767.     echo shar: \"'unipatch.c'\" unpacked with wrong size!
  2768. fi
  2769. # end of 'unipatch.c'
  2770. fi
  2771. if test -f 'util.h' -a "${1}" != "-c" ; then 
  2772.   echo shar: Will not clobber existing file \"'util.h'\"
  2773. else
  2774. echo shar: Extracting \"'util.h'\" \(1805 characters\)
  2775. sed "s/^X//" >'util.h' <<'END_OF_FILE'
  2776. X/* $Id: util.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
  2777. X *
  2778. X * $Log: util.h,v $
  2779. X * Revision 4.4  1991/09/09  20:27:37  sob
  2780. X * release 4.4
  2781. X *
  2782. X *
  2783. X * 
  2784. X */
  2785. X/* This software is Copyright 1991 by Stan Barber. 
  2786. X *
  2787. X * Permission is hereby granted to copy, reproduce, redistribute or otherwise
  2788. X * use this software as long as: there is no monetary profit gained
  2789. X * specifically from the use or reproduction of this software, it is not
  2790. X * sold, rented, traded or otherwise marketed, and this copyright notice is
  2791. X * included prominently in any copy made. 
  2792. X *
  2793. X * The author make no claims as to the fitness or correctness of this software
  2794. X * for any use whatsoever, and it is provided as is. Any use of this software
  2795. X * is at the user's own risk. 
  2796. X */
  2797. X
  2798. XEXT bool waiting INIT(FALSE);    
  2799. X            /* are we waiting for subprocess (in doshell)? */
  2800. XEXT int len_last_line_got INIT(0);
  2801. X            /* strlen of some_buf after */
  2802. X            /*  some_buf = get_a_line(bufptr,buffersize,fp) */
  2803. X
  2804. X/* is the string for makedir a directory name or a filename? */
  2805. X
  2806. X#define MD_DIR     0
  2807. X#define MD_FILE 1
  2808. X
  2809. void    util_init ANSI((void));
  2810. int    doshell ANSI((char *,char *));
  2811. char    *safemalloc ANSI((MEM_SIZE));
  2812. char    *saferealloc ANSI((char *,MEM_SIZE));
  2813. char    *safecpy ANSI((char *,char *,int));
  2814. char    *safecat ANSI((char *,char *,int));
  2815. char    *cpytill ANSI((char *,char *,int));
  2816. char    *instr ANSI((char *,char *, int));
  2817. X#ifdef SETUIDGID
  2818. X    int        eaccess ANSI((char *,int));
  2819. X#endif
  2820. char    *getwd ANSI((char *));
  2821. char    *get_a_line ANSI((char *,int,FILE *));
  2822. char    *savestr ANSI((char *));
  2823. int    makedir ANSI((char *,int));
  2824. void    setenv ANSI((char *,char *));
  2825. int    envix ANSI((char *));
  2826. void    notincl ANSI((char *));
  2827. char    *getval ANSI((char *,char *));
  2828. void    growstr ANSI((char **,int *,int));
  2829. void    setdef ANSI((char *,char *));
  2830. X#ifdef SERVER
  2831. int    nntp_get ANSI((char *, int));
  2832. X#endif
  2833. END_OF_FILE
  2834. if test 1805 -ne `wc -c <'util.h'`; then
  2835.     echo shar: \"'util.h'\" unpacked with wrong size!
  2836. fi
  2837. # end of 'util.h'
  2838. fi
  2839. echo shar: End of archive 1 \(of 13\).
  2840. cp /dev/null ark1isdone
  2841. MISSING=""
  2842. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  2843.     if test ! -f ark${I}isdone ; then
  2844.     MISSING="${MISSING} ${I}"
  2845.     fi
  2846. done
  2847. if test "${MISSING}" = "" ; then
  2848.     echo You have unpacked all 13 archives.
  2849.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2850. else
  2851.     echo You still need to unpack the following archives:
  2852.     echo "        " ${MISSING}
  2853. fi
  2854. ##  End of shell archive.
  2855. exit 0
  2856.